dain 2004/04/01 17:36:52
Modified: modules/core/src/java/org/openejb/slsb
StatelessContainerBuilder.java
Log:
Stubbed in a deployer and a simple test.
Deployment doesn't actually work, but we have a start.
Revision Changes Path
1.2 +19 -17
openejb/modules/core/src/java/org/openejb/slsb/StatelessContainerBuilder.java
Index: StatelessContainerBuilder.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/slsb/StatelessContainerBuilder.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StatelessContainerBuilder.java 21 Mar 2004 21:26:37 -0000 1.1
+++ StatelessContainerBuilder.java 1 Apr 2004 22:36:52 -0000 1.2
@@ -51,16 +51,16 @@
import java.util.LinkedHashMap;
import javax.ejb.SessionContext;
+import org.apache.geronimo.gbean.jmx.GBeanMBean;
+
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.dispatch.InterfaceMethodSignature;
import org.openejb.dispatch.MethodSignature;
import org.openejb.dispatch.VirtualOperation;
-import org.openejb.dispatch.InterfaceMethodSignature;
-import org.openejb.slsb.BusinessMethod;
import org.openejb.proxy.EJBProxyFactory;
/**
@@ -72,14 +72,22 @@
}
public EJBContainer createContainer() throws Exception {
+ return (EJBContainer) buildIt(true);
+ }
+
+ public GBeanMBean createConfiguration() throws Exception {
+ return (GBeanMBean) buildIt(false);
+ }
+
+ private Object buildIt(boolean buildContainer) throws Exception {
// get the bean class
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ ClassLoader classLoader = getClassLoader();
Class beanClass = classLoader.loadClass(getBeanClassName());
// build the vop table
LinkedHashMap vopMap = buildVopMap(beanClass);
InterfaceMethodSignature[] signatures = (InterfaceMethodSignature[])
vopMap.keySet().toArray(new InterfaceMethodSignature[vopMap.size()]);
- VirtualOperation[] vtable = (VirtualOperation[])vopMap.values().toArray(new
VirtualOperation[vopMap.size()]);
+ VirtualOperation[] vtable = (VirtualOperation[])
vopMap.values().toArray(new VirtualOperation[vopMap.size()]);
EJBProxyFactory proxyFactory = createProxyFactory(signatures);
@@ -93,17 +101,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) {