dain 2004/04/03 20:49:10
Modified: modules/core/src/java/org/openejb/sfsb
StatefulContainerBuilder.java
StatefulInstanceContextFactory.java
StatefulInstanceFactory.java
Log:
Added deployment support for Stateful and BMP beans
Fixed more serialization problems
Added ContainerBuilder interface
Revision Changes Path
1.2 +11 -20
openejb/modules/core/src/java/org/openejb/sfsb/StatefulContainerBuilder.java
Index: StatefulContainerBuilder.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/sfsb/StatefulContainerBuilder.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StatefulContainerBuilder.java 21 Mar 2004 21:26:36 -0000 1.1
+++ StatefulContainerBuilder.java 4 Apr 2004 01:49:10 -0000 1.2
@@ -49,20 +49,18 @@
import java.lang.reflect.Method;
import java.util.LinkedHashMap;
-import javax.ejb.SessionContext;
import javax.ejb.Handle;
+import javax.ejb.SessionContext;
import org.openejb.AbstractContainerBuilder;
import org.openejb.EJBComponentType;
-import org.openejb.EJBContainer;
-import org.openejb.GenericEJBContainer;
import org.openejb.InterceptorBuilder;
import org.openejb.cache.InstancePool;
import org.openejb.cache.SimpleInstanceCache;
-import org.openejb.dispatch.MethodSignature;
-import org.openejb.dispatch.VirtualOperation;
import org.openejb.dispatch.InterfaceMethodSignature;
import org.openejb.dispatch.MethodHelper;
+import org.openejb.dispatch.MethodSignature;
+import org.openejb.dispatch.VirtualOperation;
import org.openejb.proxy.EJBProxyFactory;
/**
@@ -73,10 +71,9 @@
return EJBComponentType.STATEFUL;
}
- public EJBContainer createContainer() throws Exception {
+ protected Object buildIt(boolean buildContainer) throws Exception {
// get the bean class
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- Class beanClass = classLoader.loadClass(getBeanClassName());
+ Class beanClass = getClassLoader().loadClass(getBeanClassName());
// build the vop table
LinkedHashMap vopMap = buildVopMap(beanClass);
@@ -97,17 +94,11 @@
// build the pool
InstancePool pool = createInstancePool(instanceFactory);
- // construct the container
- return new GenericEJBContainer(
- getContainerId(),
- getEJBName(),
- proxyFactory,
- signatures,
- interceptorBuilder,
- pool,
- getUserTransaction(),
- getTransactionManager(),
- getTrackedConnectionAssociator());
+ if (buildContainer) {
+ return createContainer(proxyFactory, signatures, interceptorBuilder,
pool);
+ } else {
+ return createConfiguration(proxyFactory, signatures,
interceptorBuilder, pool);
+ }
}
protected LinkedHashMap buildVopMap(Class beanClass) {
1.2 +2 -2
openejb/modules/core/src/java/org/openejb/sfsb/StatefulInstanceContextFactory.java
Index: StatefulInstanceContextFactory.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/sfsb/StatefulInstanceContextFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StatefulInstanceContextFactory.java 21 Mar 2004 21:26:36 -0000 1.1
+++ StatefulInstanceContextFactory.java 4 Apr 2004 01:49:10 -0000 1.2
@@ -63,7 +63,7 @@
*
* @version $Revision$ $Date$
*/
-public class StatefulInstanceContextFactory implements InstanceContextFactory {
+public class StatefulInstanceContextFactory implements InstanceContextFactory,
Serializable {
private final Object containerId;
private final EJBProxyFactory proxyFactory;
private final EJBInstanceFactory factory;
1.3 +3 -2
openejb/modules/core/src/java/org/openejb/sfsb/StatefulInstanceFactory.java
Index: StatefulInstanceFactory.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/sfsb/StatefulInstanceFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- StatefulInstanceFactory.java 21 Mar 2004 21:26:36 -0000 1.2
+++ StatefulInstanceFactory.java 4 Apr 2004 01:49:10 -0000 1.3
@@ -47,6 +47,7 @@
*/
package org.openejb.sfsb;
+import java.io.Serializable;
import javax.ejb.SessionBean;
import org.apache.commons.logging.Log;
@@ -67,7 +68,7 @@
*
* @version $Revision$ $Date$
*/
-public class StatefulInstanceFactory implements InstanceFactory {
+public class StatefulInstanceFactory implements InstanceFactory, Serializable {
private static final Log log = LogFactory.getLog(StatefulInstanceFactory.class);
private final ReadOnlyContext componentContext;