1 25 package org.objectweb.easybeans.tests.common.helper; 26 27 import javax.ejb.EJBContext ; 28 import javax.naming.Context ; 29 import javax.naming.InitialContext ; 30 import javax.naming.NamingException ; 31 32 38 public final class EJBContextHelper { 39 40 44 private EJBContextHelper() { 45 46 } 47 48 53 public static EJBContext getEJBContext() throws NamingException { 54 System.setProperty(Context.INITIAL_CONTEXT_FACTORY, 56 "org.objectweb.carol.jndi.spi.MultiOrbInitialContextFactory"); 57 58 Context initialContext = new InitialContext (); 59 EJBContext ejbContext = (EJBContext ) initialContext.lookup("java:comp/EJBContext"); 60 return ejbContext; 61 } 62 } 63 | Popular Tags |