dain 2004/04/15 22:34:08
Modified: modules/core/src/java/org/openejb/slsb
StatelessContainerBuilder.java
StatelessInstanceContextFactory.java
Log:
Changed container id to a String
Simplified requirements to create an EJBProxyFactory
EJBProxyFactory is now constructed in the GenericEJBContainer constructor
Change ProxyRefAddress to store the class names instead of a proxy info
object; this allows the construction of an ejb-ref without knowing the
container type
Merged stateless and stateful object base classes into a single class,
which simplifies proxy construction
Revision Changes Path
1.5 +4 -7
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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- StatelessContainerBuilder.java 6 Apr 2004 18:41:47 -0000 1.4
+++ StatelessContainerBuilder.java 16 Apr 2004 02:34:08 -0000 1.5
@@ -57,7 +57,6 @@
import org.openejb.dispatch.InterfaceMethodSignature;
import org.openejb.dispatch.MethodSignature;
import org.openejb.dispatch.VirtualOperation;
-import org.openejb.proxy.EJBProxyFactory;
/**
* @version $Revision$ $Date$
@@ -77,22 +76,20 @@
InterfaceMethodSignature[] signatures = (InterfaceMethodSignature[])
vopMap.keySet().toArray(new InterfaceMethodSignature[vopMap.size()]);
VirtualOperation[] vtable = (VirtualOperation[])
vopMap.values().toArray(new VirtualOperation[vopMap.size()]);
- EJBProxyFactory proxyFactory = createProxyFactory(signatures);
-
// create and intitalize the interceptor builder
InterceptorBuilder interceptorBuilder = initializeInterceptorBuilder(new
StatelessInterceptorBuilder(), signatures, vtable);
// build the instance factory
- StatelessInstanceContextFactory contextFactory = new
StatelessInstanceContextFactory(getContainerId(), proxyFactory, beanClass,
getUserTransaction());
+ StatelessInstanceContextFactory contextFactory = new
StatelessInstanceContextFactory(getContainerId(), beanClass, getUserTransaction());
StatelessInstanceFactory instanceFactory = new
StatelessInstanceFactory(getComponentContext(), contextFactory, beanClass);
// build the pool
InstancePool pool = createInstancePool(instanceFactory);
if (buildContainer) {
- return createContainer(proxyFactory, signatures, interceptorBuilder,
pool);
+ return createContainer(signatures, contextFactory, interceptorBuilder,
pool);
} else {
- return createConfiguration(proxyFactory, signatures,
interceptorBuilder, pool);
+ return createConfiguration(signatures, contextFactory,
interceptorBuilder, pool);
}
}
1.3 +10 -4
openejb/modules/core/src/java/org/openejb/slsb/StatelessInstanceContextFactory.java
Index: StatelessInstanceContextFactory.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/slsb/StatelessInstanceContextFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- StatelessInstanceContextFactory.java 6 Apr 2004 00:43:07 -0000 1.2
+++ StatelessInstanceContextFactory.java 16 Apr 2004 02:34:08 -0000 1.3
@@ -63,18 +63,24 @@
*/
public class StatelessInstanceContextFactory implements InstanceContextFactory,
Serializable {
private final Object containerId;
- private final EJBProxyFactory proxyFactory;
private final EJBInstanceFactory factory;
private final UserTransactionImpl userTransaction;
+ private EJBProxyFactory proxyFactory;
- public StatelessInstanceContextFactory(Object containerId, EJBProxyFactory
proxyFactory, Class beanClass, UserTransactionImpl userTransaction) {
+ public StatelessInstanceContextFactory(Object containerId, Class beanClass,
UserTransactionImpl userTransaction) {
this.containerId = containerId;
- this.proxyFactory = proxyFactory;
this.userTransaction = userTransaction;
this.factory = new EJBInstanceFactoryImpl(beanClass);
}
+ public void setProxyFactory(EJBProxyFactory proxyFactory) {
+ this.proxyFactory = proxyFactory;
+ }
+
public InstanceContext newInstance() throws Exception {
+ if (proxyFactory == null) {
+ throw new IllegalStateException("ProxyFacory has not been set");
+ }
return new StatelessInstanceContext(
containerId,
(SessionBean) factory.newInstance(),