1 package sample; 2 3 import java.rmi.RemoteException ; 4 5 6 11 public class SampleWebServiceImpl implements SampleWebServiceSEI { 12 13 14 18 public String operation1() throws RemoteException { 19 return lookupSampleSessionBean().sampleBusinessMethod(); 21 } 22 23 26 public String operation2(String a, int b) throws java.lang.Exception , java.rmi.RemoteException { 27 return null; 29 } 30 31 private sample.SampleSessionRemote lookupSampleSessionBean() { 32 try { 33 javax.naming.Context c = new javax.naming.InitialContext (); 34 Object remote = c.lookup("java:comp/env/ejb/SampleSessionBean"); 35 sample.SampleSessionRemoteHome rv = (sample.SampleSessionRemoteHome) javax.rmi.PortableRemoteObject.narrow(remote, sample.SampleSessionRemoteHome.class); 36 return rv.create(); 37 } 38 catch(javax.naming.NamingException ne) { 39 java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ne); 40 throw new RuntimeException (ne); 41 } 42 catch(javax.ejb.CreateException ce) { 43 java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ce); 44 throw new RuntimeException (ce); 45 } 46 catch(java.rmi.RemoteException re) { 47 java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,re); 48 throw new RuntimeException (re); 49 } 50 } 51 } 52
| Popular Tags
|