1 4 package org.objectweb.jonas.jtests.beans.mcontext; 5 6 import javax.ejb.CreateException ; 7 import javax.ejb.SessionBean ; 8 import javax.ejb.SessionContext ; 9 import javax.xml.rpc.handler.MessageContext ; 10 11 import org.objectweb.jonas.common.Log; 12 import org.objectweb.util.monolog.api.BasicLevel; 13 import org.objectweb.util.monolog.api.Logger; 14 15 16 19 public class TestMC2SLR implements SessionBean { 20 21 static private Logger logger = null; 22 SessionContext ejbContext; 23 24 28 29 public void setSessionContext(SessionContext ctx) { 30 if (logger == null) { 31 logger = Log.getLogger("org.objectweb.jonas_tests"); 32 } 33 logger.log(BasicLevel.DEBUG, ""); 34 ejbContext = ctx; 35 } 36 37 38 public void ejbRemove() { 39 logger.log(BasicLevel.DEBUG, ""); 40 } 41 42 43 public void ejbCreate() throws CreateException { 44 logger.log(BasicLevel.DEBUG, ""); 45 } 46 47 public void ejbPassivate() { 48 logger.log(BasicLevel.DEBUG, ""); 49 } 50 51 public void ejbActivate() { 52 logger.log(BasicLevel.DEBUG, ""); 53 } 54 55 59 public boolean serviceEndpointMethodHasMessageContext() { 60 logger.log(BasicLevel.DEBUG, ""); 61 return hasMessageContext(); 62 } 63 64 public boolean remoteMethodHasMessageContext() { 65 logger.log(BasicLevel.DEBUG, ""); 66 return hasMessageContext(); 67 } 68 69 private boolean hasMessageContext() { 70 try { 71 MessageContext mc = ejbContext.getMessageContext(); 72 if (mc != null) { 73 return true; 74 } else { 75 return false; 76 } 77 } catch(IllegalStateException ise) { 78 return false; 79 } 80 } 81 82 } 83 84 | Popular Tags |