1 45 package org.openejb.core.stateless; 46 47 import javax.xml.rpc.handler.MessageContext ; 48 49 import org.openejb.RpcContainer; 50 import org.openejb.core.DeploymentInfo; 51 import org.openejb.core.Operations; 52 import org.openejb.core.ThreadContext; 53 import org.openejb.core.ivm.EjbObjectProxyHandler; 54 55 63 public class StatelessContext 64 extends org.openejb.core.CoreContext implements javax.ejb.SessionContext { 65 public void checkBeanState(byte methodCategory) throws IllegalStateException { 66 77 ThreadContext callContext = ThreadContext.getThreadContext(); 78 DeploymentInfo di = callContext.getDeploymentInfo(); 79 80 switch(callContext.getCurrentOperation()){ 81 case Operations.OP_SET_CONTEXT: 82 94 if(methodCategory != EJBHOME_METHOD) 95 throw new IllegalStateException ("Invalid operation attempted"); 96 break; 97 case Operations.OP_CREATE: 98 case Operations.OP_REMOVE: 99 111 if( methodCategory == EJBHOME_METHOD 112 || methodCategory == EJBOBJECT_METHOD 113 || methodCategory == USER_TRANSACTION_METHOD) 114 break; 115 else 116 throw new IllegalStateException ("Invalid operation attempted"); 117 case Operations.OP_BUSINESS: 118 130 break; 131 } 132 133 } 134 135 protected EjbObjectProxyHandler newEjbObjectHandler(RpcContainer container, Object pk, Object depID){ 136 return new StatelessEjbObjectHandler(container, pk, depID); 137 } 138 139 public MessageContext getMessageContext() { 140 return null; } 142 143 } | Popular Tags |