You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by ad...@apache.org on 2007/01/18 09:24:15 UTC
svn commit: r497345 - in
/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core:
./ cmp/ entity/ mdb/ stateful/ stateless/
Author: adc
Date: Thu Jan 18 00:24:12 2007
New Revision: 497345
URL: http://svn.apache.org/viewvc?view=rev&rev=497345
Log:
Some light refactoring and more new contexts
Added:
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseSessionContext.java (contents, props changed)
- copied, changed from r497321, incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/SlsbContext.java
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/OldEntityContext.java (contents, props changed)
- copied, changed from r497321, incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContext.java
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContext.java (with props)
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/OldMdbContext.java
- copied, changed from r497321, incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContext.java
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/OldStatefulContext.java (contents, props changed)
- copied, changed from r497321, incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java (with props)
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/OldStatelessContext.java (contents, props changed)
- copied, changed from r497321, incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java (with props)
Removed:
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContext.java
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/SlsbContext.java
Modified:
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseContext.java
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreContext.java
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/CmpContainer.java
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityInstanceManager.java
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbInstanceFactory.java
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulInstanceManager.java
incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessInstanceManager.java
Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseContext.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseContext.java?view=diff&rev=497345&r1=497344&r2=497345
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseContext.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseContext.java Thu Jan 18 00:24:12 2007
@@ -265,7 +265,10 @@
}
public boolean isUserTransactionAccessAllowed() {
- return true;
+ ThreadContext threadContext = ThreadContext.getThreadContext();
+ DeploymentInfo di = threadContext.getDeploymentInfo();
+
+ return di.isBeanManagedTransaction();
}
public boolean isMessageContextAccessAllowed() {
Copied: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseSessionContext.java (from r497321, incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/SlsbContext.java)
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseSessionContext.java?view=diff&rev=497345&p1=incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/SlsbContext.java&r1=497321&p2=incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseSessionContext.java&r2=497345
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/SlsbContext.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseSessionContext.java Thu Jan 18 00:24:12 2007
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.openejb.core.stateless;
+package org.apache.openejb.core;
import java.lang.reflect.Method;
import java.security.Principal;
@@ -22,45 +22,35 @@
import javax.ejb.EJBObject;
import javax.ejb.SessionContext;
import javax.ejb.TimerService;
-import javax.transaction.UserTransaction;
import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
import javax.xml.rpc.handler.MessageContext;
import org.apache.openejb.DeploymentInfo;
import org.apache.openejb.InterfaceType;
import org.apache.openejb.InternalErrorException;
import org.apache.openejb.RpcContainer;
-import org.apache.openejb.spi.SecurityService;
-import org.apache.openejb.core.BaseContext;
-import org.apache.openejb.core.Operation;
-import org.apache.openejb.core.ThreadContext;
import org.apache.openejb.core.ivm.EjbObjectProxyHandler;
import org.apache.openejb.core.ivm.IntraVmProxy;
+import org.apache.openejb.core.stateless.StatelessEjbObjectHandler;
+import org.apache.openejb.spi.SecurityService;
import org.apache.openejb.util.proxy.ProxyManager;
/**
* @version $Rev$ $Date$
*/
-public class SlsbContext extends BaseContext implements SessionContext {
+public abstract class BaseSessionContext extends BaseContext implements SessionContext {
- public SlsbContext(TransactionManager transactionManager, SecurityService securityService) {
+ public BaseSessionContext(TransactionManager transactionManager, SecurityService securityService) {
super(transactionManager, securityService);
}
- public SlsbContext(TransactionManager transactionManager, SecurityService securityService, UserTransaction userTransaction) {
+ public BaseSessionContext(TransactionManager transactionManager, SecurityService securityService, UserTransaction userTransaction) {
super(transactionManager, securityService, userTransaction);
}
- protected void init() {
- states[Operation.INJECTION.ordinal()] = INJECTION;
- states[Operation.LIFECYCLE.ordinal()] = LIFECYCLE;
- states[Operation.BUSINESS.ordinal()] = BUSINESS;
- states[Operation.BUSINESS_WS.ordinal()] = BUSINESS_WS;
- states[Operation.TIMEOUT.ordinal()] = TIMEOUT;
- }
-
public EJBLocalObject getEJBLocalObject() throws IllegalStateException {
return ((StatelessState) getState()).getEJBLocalObject();
}
@@ -150,7 +140,7 @@
/**
* Dependency injection methods (e.g., setSessionContext)
*/
- private final StatelessState INJECTION = new StatelessState() {
+ protected final StatelessState INJECTION = new StatelessState() {
public EJBLocalObject getEJBLocalObject() throws IllegalStateException {
throw new IllegalStateException();
}
@@ -227,7 +217,7 @@
/**
* PostConstruct, Pre-Destroy lifecycle callback interceptor methods
*/
- private final StatelessState LIFECYCLE = new StatelessState() {
+ protected final StatelessState LIFECYCLE = new StatelessState() {
public MessageContext getMessageContext() throws IllegalStateException {
throw new IllegalStateException();
}
@@ -244,10 +234,6 @@
throw new IllegalStateException();
}
- public UserTransaction getUserTransaction() throws IllegalStateException {
- throw new IllegalStateException();
- }
-
public void setRollbackOnly() throws IllegalStateException {
throw new IllegalStateException();
}
@@ -293,59 +279,26 @@
* Business method from business interface or component interface; business
* method interceptor method
*/
- private final StatelessState BUSINESS = new StatelessState() {
+ protected final StatelessState BUSINESS = new StatelessState() {
public MessageContext getMessageContext() throws IllegalStateException {
throw new IllegalStateException();
}
- public UserTransaction getUserTransaction() throws IllegalStateException {
- throw new IllegalStateException();
- }
-
- public boolean isUserTransactionAccessAllowed() {
- return false;
- }
-
public boolean isMessageContextAccessAllowed() {
return false;
}
};
/**
- * Business method from web service endpoint
- */
- private final StatelessState BUSINESS_WS = new StatelessState() {
- public Class getInvokedBusinessInterface() {
- throw new IllegalStateException();
- }
-
- public UserTransaction getUserTransaction() throws IllegalStateException {
- throw new IllegalStateException();
- }
-
- public boolean isUserTransactionAccessAllowed() {
- return false;
- }
- };
-
- /**
* Timeout callback method
*/
- private final StatelessState TIMEOUT = new StatelessState() {
+ protected final StatelessState TIMEOUT = new StatelessState() {
public Class getInvokedBusinessInterface() {
throw new IllegalStateException();
}
public MessageContext getMessageContext() throws IllegalStateException {
throw new IllegalStateException();
- }
-
- public UserTransaction getUserTransaction() throws IllegalStateException {
- throw new IllegalStateException();
- }
-
- public boolean isUserTransactionAccessAllowed() {
- return false;
}
public boolean isMessageContextAccessAllowed() {
Propchange: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseSessionContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseSessionContext.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Id Author
Propchange: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/BaseSessionContext.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreContext.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreContext.java?view=diff&rev=497345&r1=497344&r2=497345
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreContext.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreContext.java Thu Jan 18 00:24:12 2007
@@ -27,7 +27,6 @@
import javax.transaction.Status;
import javax.transaction.TransactionManager;
import javax.transaction.UserTransaction;
-import java.util.List;
import org.apache.openejb.DeploymentInfo;
import org.apache.openejb.InterfaceType;
@@ -171,7 +170,7 @@
public Object getPrimaryKey() {
/*
- * This method is only declared in the EntityContext interface and is therefor
+ * This method is only declared in the OldEntityContext interface and is therefor
* unavailable in the SessionContext and doesn't not require a check for bean kind (Entity vs Session).
*/
checkBeanState(EJBOBJECT_METHOD);
Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/CmpContainer.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/CmpContainer.java?view=diff&rev=497345&r1=497344&r2=497345
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/CmpContainer.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/CmpContainer.java Thu Jan 18 00:24:12 2007
@@ -48,7 +48,7 @@
import org.apache.openejb.core.CoreDeploymentInfo;
import org.apache.openejb.core.Operation;
import org.apache.openejb.core.ThreadContext;
-import org.apache.openejb.core.entity.EntityContext;
+import org.apache.openejb.core.entity.OldEntityContext;
import org.apache.openejb.core.transaction.TransactionContainer;
import org.apache.openejb.core.transaction.TransactionContext;
import org.apache.openejb.core.transaction.TransactionPolicy;
@@ -277,7 +277,7 @@
ThreadContext oldCallContext = ThreadContext.enter(callContext);
try {
- entityBean.setEntityContext(new EntityContext(transactionManager, securityService));
+ entityBean.setEntityContext(new OldEntityContext(transactionManager, securityService));
} catch (RemoteException e) {
throw new EJBException(e);
} finally {
Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityInstanceManager.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityInstanceManager.java?view=diff&rev=497345&r1=497344&r2=497345
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityInstanceManager.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityInstanceManager.java Thu Jan 18 00:24:12 2007
@@ -289,8 +289,8 @@
return bean;
}
- private org.apache.openejb.core.entity.EntityContext createEntityContext() {
- return new EntityContext(transactionManager, securityService);
+ private org.apache.openejb.core.entity.OldEntityContext createEntityContext() {
+ return new OldEntityContext(transactionManager, securityService);
}
public void poolInstance(ThreadContext callContext, EntityBean bean)
Copied: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/OldEntityContext.java (from r497321, incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContext.java)
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/OldEntityContext.java?view=diff&rev=497345&p1=incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContext.java&r1=497321&p2=incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/OldEntityContext.java&r2=497345
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContext.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/OldEntityContext.java Thu Jan 18 00:24:12 2007
@@ -24,9 +24,9 @@
import javax.transaction.TransactionManager;
-public class EntityContext extends org.apache.openejb.core.CoreContext implements javax.ejb.EntityContext {
+public class OldEntityContext extends org.apache.openejb.core.CoreContext implements javax.ejb.EntityContext {
- public EntityContext(TransactionManager transactionManager, SecurityService securityService) {
+ public OldEntityContext(TransactionManager transactionManager, SecurityService securityService) {
super(transactionManager, securityService);
}
Propchange: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/entity/OldEntityContext.java
------------------------------------------------------------------------------
svn:keywords = Date Rev Author Id Revision HeadURL
Added: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContext.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContext.java?view=auto&rev=497345
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContext.java (added)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContext.java Thu Jan 18 00:24:12 2007
@@ -0,0 +1,199 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openejb.core.mdb;
+
+import java.security.Principal;
+import javax.ejb.EJBHome;
+import javax.ejb.EJBLocalHome;
+import javax.ejb.MessageDrivenContext;
+import javax.ejb.TimerService;
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+
+import org.apache.openejb.core.BaseContext;
+import org.apache.openejb.core.Operation;
+import org.apache.openejb.spi.SecurityService;
+
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class MdbContext extends BaseContext implements MessageDrivenContext {
+
+ public MdbContext(TransactionManager transactionManager, SecurityService securityService) {
+ super(transactionManager, securityService);
+ }
+
+ protected MdbContext(TransactionManager transactionManager, SecurityService securityService, UserTransaction userTransaction) {
+ super(transactionManager, securityService, userTransaction);
+ }
+
+ protected void init() {
+ states[Operation.INJECTION.ordinal()] = INJECTION;
+ states[Operation.LIFECYCLE.ordinal()] = LIFECYCLE;
+ states[Operation.BUSINESS.ordinal()] = BUSINESS_TIMEOUT;
+ states[Operation.TIMEOUT.ordinal()] = BUSINESS_TIMEOUT;
+ }
+
+ /**
+ * Dependency injection methods (e.g., setMessageDrivenContext)
+ */
+ protected final State INJECTION = new State() {
+ public EJBHome getEJBHome() {
+ throw new IllegalStateException();
+ }
+
+ public EJBLocalHome getEJBLocalHome() {
+ throw new IllegalStateException();
+ }
+
+ public Principal getCallerPrincipal() {
+ throw new IllegalStateException();
+ }
+
+ public boolean isCallerInRole(String roleName) {
+ throw new IllegalStateException();
+ }
+
+ public UserTransaction getUserTransaction() throws IllegalStateException {
+ throw new IllegalStateException();
+ }
+
+ public void setRollbackOnly() throws IllegalStateException {
+ throw new IllegalStateException();
+ }
+
+ public boolean getRollbackOnly() throws IllegalStateException {
+ throw new IllegalStateException();
+ }
+
+ public TimerService getTimerService() throws IllegalStateException {
+ throw new IllegalStateException();
+ }
+
+ public boolean isUserTransactionAccessAllowed() {
+ return false;
+ }
+
+ public boolean isMessageContextAccessAllowed() {
+ return false;
+ }
+
+ public boolean isResourceManagerAccessAllowed() {
+ return false;
+ }
+
+ public boolean isEnterpriseBeanAccessAllowed() {
+ return false;
+ }
+
+ public boolean isEntityManagerFactoryAccessAllowed() {
+ return false;
+ }
+
+ public boolean isEntityManagerAccessAllowed() {
+ return false;
+ }
+
+ public boolean isTimerAccessAllowed() {
+ return false;
+ }
+ };
+
+ /**
+ * PostConstruct, Pre-Destroy lifecycle callback interceptor methods
+ */
+ protected final State LIFECYCLE = new State() {
+ public EJBHome getEJBHome() {
+ throw new IllegalStateException();
+ }
+
+ public EJBLocalHome getEJBLocalHome() {
+ throw new IllegalStateException();
+ }
+
+ public Principal getCallerPrincipal() {
+ throw new IllegalStateException();
+ }
+
+ public boolean isCallerInRole(String roleName) {
+ throw new IllegalStateException();
+ }
+
+ public UserTransaction getUserTransaction() throws IllegalStateException {
+ throw new IllegalStateException();
+ }
+
+ public void setRollbackOnly() throws IllegalStateException {
+ throw new IllegalStateException();
+ }
+
+ public boolean getRollbackOnly() throws IllegalStateException {
+ throw new IllegalStateException();
+ }
+
+ public boolean isUserTransactionAccessAllowed() {
+ return false;
+ }
+
+ public boolean isMessageContextAccessAllowed() {
+ return false;
+ }
+
+ public boolean isResourceManagerAccessAllowed() {
+ return false;
+ }
+
+ public boolean isEnterpriseBeanAccessAllowed() {
+ return false;
+ }
+
+ public boolean isEntityManagerAccessAllowed() {
+ return false;
+ }
+
+ public boolean isTimerAccessAllowed() {
+ return super.isTimerAccessAllowed(); //todo: consider this autogenerated code
+ }
+ };
+
+ /**
+ * Message listener method, business method interceptor method
+ * and imeout callback method
+ */
+ protected final State BUSINESS_TIMEOUT = new State() {
+ public EJBHome getEJBHome() {
+ throw new IllegalStateException();
+ }
+
+ public EJBLocalHome getEJBLocalHome() {
+ throw new IllegalStateException();
+ }
+
+ public boolean isCallerInRole(String roleName) {
+ throw new IllegalStateException();
+ }
+
+ public UserTransaction getUserTransaction() throws IllegalStateException {
+ throw new IllegalStateException();
+ }
+
+ public boolean isUserTransactionAccessAllowed() {
+ return false;
+ }
+ };
+}
Propchange: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContext.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Id Author
Propchange: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContext.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbInstanceFactory.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbInstanceFactory.java?view=diff&rev=497345&r1=497344&r2=497345
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbInstanceFactory.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbInstanceFactory.java Thu Jan 18 00:24:12 2007
@@ -166,11 +166,11 @@
try {
Context ctx = deploymentInfo.getJndiEnc();
// construct the bean instance
- MdbContext mdbContext = null;
+ OldMdbContext mdbContext = null;
try {
- mdbContext = (MdbContext) ctx.lookup("java:comp/EJBContext");
+ mdbContext = (OldMdbContext) ctx.lookup("java:comp/EJBContext");
} catch (NamingException e) {
- mdbContext = new MdbContext(transactionManager, securityService);
+ mdbContext = new OldMdbContext(transactionManager, securityService);
ctx.bind("java:comp/EJBContext",mdbContext);
}
// only in this case should the callback be used
Copied: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/OldMdbContext.java (from r497321, incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContext.java)
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/OldMdbContext.java?view=diff&rev=497345&p1=incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContext.java&r1=497321&p2=incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/OldMdbContext.java&r2=497345
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContext.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/OldMdbContext.java Thu Jan 18 00:24:12 2007
@@ -32,8 +32,8 @@
import javax.ejb.EJBLocalObject;
import javax.ejb.EJBLocalHome;
-public class MdbContext extends CoreContext implements javax.ejb.MessageDrivenContext {
- public MdbContext(TransactionManager transactionManager, SecurityService securityService) {
+public class OldMdbContext extends CoreContext implements javax.ejb.MessageDrivenContext {
+ public OldMdbContext(TransactionManager transactionManager, SecurityService securityService) {
super(transactionManager, securityService);
}
Copied: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/OldStatefulContext.java (from r497321, incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java)
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/OldStatefulContext.java?view=diff&rev=497345&p1=incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java&r1=497321&p2=incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/OldStatefulContext.java&r2=497345
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/OldStatefulContext.java Thu Jan 18 00:24:12 2007
@@ -31,9 +31,9 @@
import java.io.ObjectStreamException;
import java.io.Serializable;
-public class StatefulContext extends org.apache.openejb.core.CoreContext implements javax.ejb.SessionContext {
+public class OldStatefulContext extends org.apache.openejb.core.CoreContext implements javax.ejb.SessionContext {
- public StatefulContext(TransactionManager transactionManager, SecurityService securityService, UserTransaction userTransaction) {
+ public OldStatefulContext(TransactionManager transactionManager, SecurityService securityService, UserTransaction userTransaction) {
super(transactionManager, securityService, userTransaction);
}
@@ -144,7 +144,7 @@
JtaEntityManagerRegistry jtaEntityManagerRegistry = SystemInstance.get().getComponent(JtaEntityManagerRegistry.class);
SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class);
StatefulUserTransaction userTransaction = new StatefulUserTransaction(new CoreUserTransaction(transactionManager), jtaEntityManagerRegistry);
- return new StatefulContext(transactionManager, securityService, userTransaction);
+ return new OldStatefulContext(transactionManager, securityService, userTransaction);
}
}
}
Propchange: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/OldStatefulContext.java
------------------------------------------------------------------------------
svn:keywords = Date Rev Author Id Revision HeadURL
Added: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java?view=auto&rev=497345
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java (added)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java Thu Jan 18 00:24:12 2007
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openejb.core.stateful;
+
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+
+import org.apache.openejb.core.BaseSessionContext;
+import org.apache.openejb.core.Operation;
+import org.apache.openejb.spi.SecurityService;
+
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class StatefulContext extends BaseSessionContext {
+
+ public StatefulContext(TransactionManager transactionManager, SecurityService securityService) {
+ super(transactionManager, securityService);
+ }
+
+ public StatefulContext(TransactionManager transactionManager, SecurityService securityService, UserTransaction userTransaction) {
+ super(transactionManager, securityService, userTransaction);
+ }
+
+ protected void init() {
+ states[Operation.INJECTION.ordinal()] = INJECTION;
+ states[Operation.LIFECYCLE.ordinal()] = LIFECYCLE;
+ states[Operation.BUSINESS.ordinal()] = BUSINESS;
+ states[Operation.TIMEOUT.ordinal()] = TIMEOUT;
+ }
+}
Propchange: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Id Author
Propchange: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContext.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulInstanceManager.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulInstanceManager.java?view=diff&rev=497345&r1=497344&r2=497345
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulInstanceManager.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulInstanceManager.java Thu Jan 18 00:24:12 2007
@@ -167,7 +167,7 @@
private SessionContext createSessionContext() {
StatefulUserTransaction userTransaction = new StatefulUserTransaction(new CoreUserTransaction(transactionManager), jtaEntityManagerRegistry);
- return new StatefulContext(transactionManager, securityService, userTransaction);
+ return new OldStatefulContext(transactionManager, securityService, userTransaction);
}
public Object obtainInstance(Object primaryKey, ThreadContext callContext) throws OpenEJBException {
Copied: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/OldStatelessContext.java (from r497321, incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java)
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/OldStatelessContext.java?view=diff&rev=497345&p1=incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java&r1=497321&p2=incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/OldStatelessContext.java&r2=497345
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/OldStatelessContext.java Thu Jan 18 00:24:12 2007
@@ -26,9 +26,9 @@
import javax.transaction.TransactionManager;
import javax.xml.rpc.handler.MessageContext;
-public class StatelessContext
+public class OldStatelessContext
extends org.apache.openejb.core.CoreContext implements javax.ejb.SessionContext {
- public StatelessContext(TransactionManager transactionManager, SecurityService securityService) {
+ public OldStatelessContext(TransactionManager transactionManager, SecurityService securityService) {
super(transactionManager, securityService);
}
Propchange: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/OldStatelessContext.java
------------------------------------------------------------------------------
svn:keywords = Date Rev Author Id Revision HeadURL
Added: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java?view=auto&rev=497345
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java (added)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java Thu Jan 18 00:24:12 2007
@@ -0,0 +1,57 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openejb.core.stateless;
+
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+
+import org.apache.openejb.core.BaseSessionContext;
+import org.apache.openejb.core.Operation;
+import org.apache.openejb.spi.SecurityService;
+
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class StatelessContext extends BaseSessionContext {
+
+ public StatelessContext(TransactionManager transactionManager, SecurityService securityService) {
+ super(transactionManager, securityService);
+ }
+
+ public StatelessContext(TransactionManager transactionManager, SecurityService securityService, UserTransaction userTransaction) {
+ super(transactionManager, securityService, userTransaction);
+ }
+
+ protected void init() {
+ states[Operation.INJECTION.ordinal()] = INJECTION;
+ states[Operation.LIFECYCLE.ordinal()] = LIFECYCLE;
+ states[Operation.BUSINESS.ordinal()] = BUSINESS;
+ states[Operation.BUSINESS_WS.ordinal()] = BUSINESS_WS;
+ states[Operation.TIMEOUT.ordinal()] = TIMEOUT;
+ }
+
+ /**
+ * Business method from web service endpoint
+ */
+ private final StatelessState BUSINESS_WS = new StatelessState() {
+ public Class getInvokedBusinessInterface() {
+ throw new IllegalStateException();
+ }
+ };
+
+}
Propchange: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Id Author
Propchange: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessContext.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessInstanceManager.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessInstanceManager.java?view=diff&rev=497345&r1=497344&r2=497345
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessInstanceManager.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessInstanceManager.java Thu Jan 18 00:24:12 2007
@@ -140,7 +140,7 @@
}
private SessionContext createSessionContext() {
- return (SessionContext) new StatelessContext(transactionManager, securityService);
+ return (SessionContext) new OldStatelessContext(transactionManager, securityService);
}
public void poolInstance(ThreadContext callContext, Object bean) throws OpenEJBException {