1 22 package org.jboss.ejb3.test.reference21_30; 23 24 import javax.ejb.Remote ; 25 import javax.ejb.RemoteHome ; 26 import javax.ejb.Stateless ; 27 import javax.ejb.EJB ; 28 import javax.naming.InitialContext ; 29 import javax.ejb.EJBs ; 30 31 import org.jboss.annotation.ejb.RemoteBinding; 32 import org.jboss.ejb3.Container; 33 34 import org.jboss.logging.Logger; 35 36 40 @Stateless (name="Test3") 41 @Remote (Test3.class) 42 @RemoteBinding(jndiBinding="Test3") 43 @RemoteHome (Test3Home.class) 44 @EJBs ({@EJB (name="injected/Test2", mappedName="Test2")}) 45 public class Test3Bean 46 implements Test3 47 { 48 private static final Logger log = Logger.getLogger(Test3Bean.class); 49 50 @EJB (name="ejb/Test2") 51 private Test2Home test2Home=null; 52 53 public void testAccess() throws Exception 54 { 55 Test2 test2 = test2Home.create(); 56 try { 57 InitialContext jndiContext = new InitialContext (); 58 Test2Home home = (Test2Home)jndiContext.lookup(Container.ENC_CTX_NAME + "/env/injected/Test2"); 59 test2 = home.create(); 60 } catch (Exception e) 61 { 62 e.printStackTrace(); 63 } 64 } 65 } 66 | Popular Tags |