1 25 package org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged; 26 27 import javax.ejb.Remote ; 28 import javax.ejb.Stateless ; 29 import javax.naming.Context ; 30 import javax.naming.InitialContext ; 31 import javax.naming.NamingException ; 32 33 import org.objectweb.easybeans.tests.common.ejbs.base.ItfModifyEnvironment; 34 35 36 42 @Stateless 43 @Remote (ItfModifyEnvironment.class) 44 public class SLSBModifyEnvironment00 implements ItfModifyEnvironment{ 45 46 49 @SuppressWarnings ("boxing") 50 public void modifyEnvironment(){ 51 try { 52 Context initCtx = new InitialContext (); 53 Context myEnv = (Context ) initCtx.lookup("java:comp/env"); 54 55 myEnv.addToEnvironment("flt00", new Float (INJECTED_FLOAT)); 56 myEnv.removeFromEnvironment("flt00"); 57 58 } catch (NamingException e) { 59 throw new IllegalStateException ("The context could not be obtained."); 60 } 61 } 62 } 63 | Popular Tags |