1 25 package org.objectweb.easybeans.tests.common.resources; 26 27 import javax.annotation.Resource; 28 import javax.ejb.EJBContext ; 29 30 31 37 public class EJBContextTester { 38 39 42 @Resource(name = "ejbctx/ctx00") 43 private EJBContext context; 44 45 48 public EJBContextTester(){ 49 } 50 51 55 @SuppressWarnings ("unused") 56 protected void access00() throws Exception { 57 checkInstance(context); 58 } 59 60 65 public static void checkInstance(final EJBContext ctx) throws Exception { 66 if (ctx == null){ 68 throw new Exception ("EJBContext is null."); 69 } 70 71 EJBContext ctx00 = (EJBContext ) ctx.lookup("java:comp/EJBContext"); 72 73 if (ctx00 == null){ 74 throw new Exception ("EJBContext could not get using another EJBContext reference."); 75 } 76 } 77 } 78 | Popular Tags |