1 package test; 2 3 import java.util.logging.Level ; 4 import java.util.logging.Logger ; 5 import javax.ejb.*; 6 import javax.naming.Context ; 7 import javax.naming.InitialContext ; 8 import javax.naming.NamingException ; 9 10 15 public class TestingSessionBean implements SessionBean, TestingSessionRemoteBusiness, TestingSessionLocalBusiness { 16 private SessionContext context; 17 18 24 public void setSessionContext(SessionContext aContext) { 25 context = aContext; 26 } 27 28 31 public void ejbActivate() { 32 33 } 34 35 38 public void ejbPassivate() { 39 40 } 41 42 45 public void ejbRemove() { 46 47 } 48 50 54 public void ejbCreate() { 55 } 60 61 62 63 66 public String testBusinessMethod1() { 67 return null; 69 } 70 71 public String testBusinessMethod2(String a, int b) throws Exception { 72 return null; 74 } 75 76 private TestingEntityLocalHome lookupTestingEntityBean() { 77 try { 78 Context c = new InitialContext (); 79 TestingEntityLocalHome rv = (TestingEntityLocalHome) c.lookup("java:comp/env/ejb/TestingEntityBean"); 80 return rv; 81 } 82 catch(NamingException ne) { 83 Logger.getLogger(getClass().getName()).log(Level.SEVERE,"exception caught" ,ne); 84 throw new RuntimeException (ne); 85 } 86 } 87 88 89 90 } 91
| Popular Tags
|