djencks 2004/07/18 18:32:19
Modified: modules/core/src/java/org/openejb
AbstractContainerBuilder.java
AbstractInstanceContext.java
AbstractInterceptorBuilder.java
ContainerBuilder.java EJBContextImpl.java
EJBInstanceContext.java EJBInvocation.java
EJBInvocationImpl.java GenericEJBContainer.java
InstanceContextFactory.java InterceptorBuilder.java
OpenEJB.java
Log:
Add timer support to session and mdbs. (entities still todo). Adapt to
TransactionContextManager. Adapt to deploying with external plan.
Revision Changes Path
1.14 +65 -21
openejb/modules/core/src/java/org/openejb/AbstractContainerBuilder.java
Index: AbstractContainerBuilder.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/AbstractContainerBuilder.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- AbstractContainerBuilder.java 3 Jun 2004 07:27:01 -0000 1.13
+++ AbstractContainerBuilder.java 18 Jul 2004 22:32:18 -0000 1.14
@@ -50,13 +50,16 @@
import java.util.Set;
import javax.security.auth.Subject;
-import javax.transaction.TransactionManager;
+import javax.management.ObjectName;
+import javax.ejb.TimedObject;
+import javax.ejb.Timer;
import org.apache.geronimo.gbean.jmx.GBeanMBean;
import org.apache.geronimo.kernel.ClassLoading;
import org.apache.geronimo.naming.java.ReadOnlyContext;
import org.apache.geronimo.transaction.TrackedConnectionAssociator;
import org.apache.geronimo.transaction.UserTransactionImpl;
+import org.apache.geronimo.transaction.context.TransactionContextManager;
import org.openejb.cache.InstanceFactory;
import org.openejb.cache.InstancePool;
import org.openejb.deployment.TransactionPolicySource;
@@ -65,6 +68,8 @@
import org.openejb.proxy.ProxyInfo;
import org.openejb.security.PermissionManager;
import org.openejb.transaction.TransactionPolicyManager;
+import org.openejb.transaction.TransactionPolicy;
+import org.openejb.transaction.ContainerPolicy;
import org.openejb.util.SoftLimitedInstancePool;
/**
@@ -90,9 +95,13 @@
private TransactionPolicySource transactionPolicySource;
private String[] jndiNames;
private String[] localJndiNames;
- private TransactionManager transactionManager;
+ //todo use object names here for build configuration rather than in
ModuleBuilder.
+ private TransactionContextManager transactionContextManager;
private TrackedConnectionAssociator trackedConnectionAssociator;
+ private ObjectName transactedTimerName;
+ private ObjectName nonTransactedTimerName;
+
public ClassLoader getClassLoader() {
return classLoader;
}
@@ -229,12 +238,12 @@
this.localJndiNames = localJndiNames;
}
- public TransactionManager getTransactionManager() {
- return transactionManager;
+ public TransactionContextManager getTransactionContextManager() {
+ return transactionContextManager;
}
- public void setTransactionManager(TransactionManager transactionManager) {
- this.transactionManager = transactionManager;
+ public void setTransactionContextManager(TransactionContextManager
transactionContextManager) {
+ this.transactionContextManager = transactionContextManager;
}
public TrackedConnectionAssociator getTrackedConnectionAssociator() {
@@ -245,6 +254,22 @@
this.trackedConnectionAssociator = trackedConnectionAssociator;
}
+ public ObjectName getTransactedTimerName() {
+ return transactedTimerName;
+ }
+
+ public void setTransactedTimerName(ObjectName transactedTimerName) {
+ this.transactedTimerName = transactedTimerName;
+ }
+
+ public ObjectName getNonTransactedTimerName() {
+ return nonTransactedTimerName;
+ }
+
+ public void setNonTransactedTimerName(ObjectName nonTransactedTimerName) {
+ this.nonTransactedTimerName = nonTransactedTimerName;
+ }
+
protected abstract int getEJBComponentType();
public EJBContainer createContainer() throws Exception {
@@ -314,29 +339,48 @@
getUserTransaction(),
getJndiNames(),
getLocalJndiNames(),
- getTransactionManager(),
- getTrackedConnectionAssociator());
+ getTransactionContextManager(),
+ getTrackedConnectionAssociator(),
+ null, //timer
+ null, //objectname
+ null);//kernel
}
protected GBeanMBean createConfiguration(
ClassLoader cl, InterfaceMethodSignature[] signatures,
InstanceContextFactory contextFactory,
InterceptorBuilder interceptorBuilder,
- InstancePool pool
- ) throws Exception {
+ InstancePool pool,
+ ObjectName timerName) throws Exception {
GBeanMBean gbean = new GBeanMBean(GenericEJBContainer.GBEAN_INFO, cl);
- gbean.setAttribute("ContainerID", getContainerId());
- gbean.setAttribute("EJBName", getEJBName());
- gbean.setAttribute("ProxyInfo", createProxyInfo());
- gbean.setAttribute("Signatures", signatures);
- gbean.setAttribute("ContextFactory", contextFactory);
- gbean.setAttribute("InterceptorBuilder", interceptorBuilder);
- gbean.setAttribute("Pool", pool);
- gbean.setAttribute("UserTransaction", getUserTransaction());
- gbean.setAttribute("JndiNames", getJndiNames());
- gbean.setAttribute("LocalJndiNames", getLocalJndiNames());
+ gbean.setAttribute("containerID", getContainerId());
+ gbean.setAttribute("ejbName", getEJBName());
+ gbean.setAttribute("proxyInfo", createProxyInfo());
+ gbean.setAttribute("signatures", signatures);
+ gbean.setAttribute("contextFactory", contextFactory);
+ gbean.setAttribute("interceptorBuilder", interceptorBuilder);
+ gbean.setAttribute("pool", pool);
+ gbean.setAttribute("userTransaction", getUserTransaction());
+ gbean.setAttribute("jndiNames", getJndiNames());
+ gbean.setAttribute("localJndiNames", getLocalJndiNames());
+ gbean.setReferencePattern("Timer", timerName);
return gbean;
+ }
+
+ protected ObjectName getTimerName(Class beanClass) {
+ ObjectName timerName = null;
+ if (TimedObject.class.isAssignableFrom(beanClass)) {
+ InterfaceMethodSignature signature = new
InterfaceMethodSignature("ejbTimeout", new Class[]{Timer.class}, false);
+ TransactionPolicy transactionPolicy =
getTransactionPolicySource().getTransactionPolicy("timeout", signature);
+ boolean isTransacted = transactionPolicy == ContainerPolicy.Required ||
transactionPolicy == ContainerPolicy.RequiresNew;
+ if (isTransacted) {
+ timerName = getTransactedTimerName();
+ } else {
+ timerName = getNonTransactedTimerName();
+ }
+ }
+ return timerName;
}
}
1.4 +12 -4
openejb/modules/core/src/java/org/openejb/AbstractInstanceContext.java
Index: AbstractInstanceContext.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/AbstractInstanceContext.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AbstractInstanceContext.java 7 Jul 2004 22:17:32 -0000 1.3
+++ AbstractInstanceContext.java 18 Jul 2004 22:32:18 -0000 1.4
@@ -22,10 +22,12 @@
import java.util.Set;
import javax.ejb.EnterpriseBean;
+import javax.ejb.TimerService;
-import org.openejb.proxy.EJBProxyFactory;
-import org.openejb.dispatch.SystemMethodIndices;
import org.apache.geronimo.core.service.Interceptor;
+import org.openejb.dispatch.SystemMethodIndices;
+import org.openejb.proxy.EJBProxyFactory;
+import org.openejb.timer.TimerServiceImpl;
/**
@@ -48,9 +50,10 @@
protected EJBInvocation setContextInvocation;
protected EJBInvocation unsetContextInvocation;
protected final Interceptor systemChain;
+ private final TimerServiceImpl timerService;
- public AbstractInstanceContext(SystemMethodIndices systemMethodIndices,
Interceptor systemChain, Set unshareableResources, Set
applicationManagedSecurityResources, EnterpriseBean instance, EJBProxyFactory
proxyFactory) {
+ public AbstractInstanceContext(SystemMethodIndices systemMethodIndices,
Interceptor systemChain, Set unshareableResources, Set
applicationManagedSecurityResources, EnterpriseBean instance, EJBProxyFactory
proxyFactory, TimerServiceImpl timerService) {
this.unshareableResources = unshareableResources;
this.applicationManagedSecurityResources =
applicationManagedSecurityResources;
this.instance = instance;
@@ -58,6 +61,7 @@
this.systemChain = systemChain;
ejbActivateInvocation = systemMethodIndices.getEjbActivateInvocation(this);
ejbPassivateInvocation =
systemMethodIndices.getEjbPassivateInvocation(this);
+ this.timerService = timerService;
}
public Object getId() {
@@ -117,6 +121,10 @@
public void unsetContext() throws Throwable {
systemChain.invoke(unsetContextInvocation);
+ }
+
+ public TimerServiceImpl getTimerService() {
+ return timerService;
}
}
1.8 +5 -6
openejb/modules/core/src/java/org/openejb/AbstractInterceptorBuilder.java
Index: AbstractInterceptorBuilder.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/AbstractInterceptorBuilder.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- AbstractInterceptorBuilder.java 7 Jul 2004 22:17:32 -0000 1.7
+++ AbstractInterceptorBuilder.java 18 Jul 2004 22:32:18 -0000 1.8
@@ -48,11 +48,10 @@
package org.openejb;
import javax.security.auth.Subject;
-import javax.transaction.TransactionManager;
import org.apache.geronimo.naming.java.ReadOnlyContext;
import org.apache.geronimo.transaction.TrackedConnectionAssociator;
-import org.apache.geronimo.core.service.Interceptor;
+import org.apache.geronimo.transaction.context.TransactionContextManager;
import org.openejb.cache.InstanceCache;
import org.openejb.cache.InstanceFactory;
import org.openejb.cache.InstancePool;
@@ -75,7 +74,7 @@
protected PermissionManager permissionManager;
protected boolean setIdentityEnabled = false;
protected boolean securityEnabled = false;
- protected transient TransactionManager transactionManager;
+ protected transient TransactionContextManager transactionContextManager;
protected transient TrackedConnectionAssociator trackedConnectionAssociator;
protected transient InstancePool instancePool;
protected InstanceCache instanceCache;
@@ -124,8 +123,8 @@
this.securityEnabled = securityEnabled;
}
- public void setTransactionManager(TransactionManager transactionManager) {
- this.transactionManager = transactionManager;
+ public void setTransactionContextManager(TransactionContextManager
transactionContextManager) {
+ this.transactionContextManager = transactionContextManager;
}
public void setTrackedConnectionAssociator(TrackedConnectionAssociator
trackedConnectionAssociator) {
1.7 +13 -3 openejb/modules/core/src/java/org/openejb/ContainerBuilder.java
Index: ContainerBuilder.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/ContainerBuilder.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ContainerBuilder.java 25 Jun 2004 21:35:11 -0000 1.6
+++ ContainerBuilder.java 18 Jul 2004 22:32:18 -0000 1.7
@@ -19,12 +19,14 @@
import java.util.Set;
import javax.security.auth.Subject;
import javax.transaction.TransactionManager;
+import javax.management.ObjectName;
import org.apache.geronimo.naming.java.ReadOnlyContext;
import org.apache.geronimo.gbean.jmx.GBeanMBean;
import org.apache.geronimo.transaction.TrackedConnectionAssociator;
import org.apache.geronimo.transaction.UserTransactionImpl;
+import org.apache.geronimo.transaction.context.TransactionContextManager;
import org.openejb.deployment.TransactionPolicySource;
/**
@@ -85,9 +87,9 @@
void setTransactionPolicySource(TransactionPolicySource
transactionPolicySource);
- TransactionManager getTransactionManager();
+ TransactionContextManager getTransactionContextManager();
- void setTransactionManager(TransactionManager transactionManager);
+ void setTransactionContextManager(TransactionContextManager
transactionContextManager);
TrackedConnectionAssociator getTrackedConnectionAssociator();
@@ -104,5 +106,13 @@
EJBContainer createContainer() throws Exception;
GBeanMBean createConfiguration() throws Exception;
+
+ ObjectName getTransactedTimerName();
+
+ void setTransactedTimerName(ObjectName transactedTimerName);
+
+ ObjectName getNonTransactedTimerName();
+
+ void setNonTransactedTimerName(ObjectName nonTransactedTimerName);
}
1.4 +11 -6 openejb/modules/core/src/java/org/openejb/EJBContextImpl.java
Index: EJBContextImpl.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/EJBContextImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- EJBContextImpl.java 6 Apr 2004 00:43:06 -0000 1.3
+++ EJBContextImpl.java 18 Jul 2004 22:32:18 -0000 1.4
@@ -60,8 +60,8 @@
import javax.transaction.UserTransaction;
import org.apache.geronimo.security.ContextManager;
-import org.apache.geronimo.transaction.ContainerTransactionContext;
-import org.apache.geronimo.transaction.TransactionContext;
+import org.apache.geronimo.transaction.context.ContainerTransactionContext;
+import org.apache.geronimo.transaction.context.TransactionContext;
import org.apache.geronimo.transaction.UserTransactionImpl;
@@ -128,7 +128,7 @@
}
public TimerService getTimerService() {
- return state.getTimerService();
+ return state.getTimerService(context);
}
public Properties getEnvironment() {
@@ -216,8 +216,13 @@
}
}
- public TimerService getTimerService() {
- throw new UnsupportedOperationException();
+ public TimerService getTimerService(EJBInstanceContext context) {
+ TimerService timerService = context.getTimerService();
+ if (timerService == null) {
+ //TODO is this correct?
+ throw new IllegalStateException("EJB does not implement
EJBTimeout");
+ }
+ return timerService;
}
}
}
1.3 +4 -1
openejb/modules/core/src/java/org/openejb/EJBInstanceContext.java
Index: EJBInstanceContext.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/EJBInstanceContext.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EJBInstanceContext.java 21 Mar 2004 21:26:34 -0000 1.2
+++ EJBInstanceContext.java 18 Jul 2004 22:32:19 -0000 1.3
@@ -52,6 +52,7 @@
import org.apache.geronimo.transaction.InstanceContext;
import org.openejb.proxy.EJBProxyFactory;
+import org.openejb.timer.TimerServiceImpl;
/**
*
@@ -66,4 +67,6 @@
void setOperation(EJBOperation operation);
EJBProxyFactory getProxyFactory();
+
+ TimerServiceImpl getTimerService();
}
1.2 +2 -2 openejb/modules/core/src/java/org/openejb/EJBInvocation.java
Index: EJBInvocation.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/EJBInvocation.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EJBInvocation.java 1 Mar 2004 07:14:42 -0000 1.1
+++ EJBInvocation.java 18 Jul 2004 22:32:19 -0000 1.2
@@ -49,7 +49,7 @@
import org.apache.geronimo.core.service.Invocation;
-import org.apache.geronimo.transaction.TransactionContext;
+import org.apache.geronimo.transaction.context.TransactionContext;
/**
* Specialization of Invocation to define attributes specific to the
1.3 +2 -2 openejb/modules/core/src/java/org/openejb/EJBInvocationImpl.java
Index: EJBInvocationImpl.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/EJBInvocationImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EJBInvocationImpl.java 7 Jul 2004 22:17:32 -0000 1.2
+++ EJBInvocationImpl.java 18 Jul 2004 22:32:19 -0000 1.3
@@ -53,7 +53,7 @@
import org.apache.geronimo.core.service.SimpleInvocation;
-import org.apache.geronimo.transaction.TransactionContext;
+import org.apache.geronimo.transaction.context.TransactionContext;
/**
*
1.14 +82 -39
openejb/modules/core/src/java/org/openejb/GenericEJBContainer.java
Index: GenericEJBContainer.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/GenericEJBContainer.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- GenericEJBContainer.java 7 Jul 2004 22:17:32 -0000 1.13
+++ GenericEJBContainer.java 18 Jul 2004 22:32:19 -0000 1.14
@@ -49,32 +49,39 @@
import java.lang.reflect.Method;
import java.rmi.RemoteException;
+
import javax.ejb.EJBHome;
import javax.ejb.EJBLocalHome;
import javax.ejb.EJBLocalObject;
import javax.ejb.EJBObject;
import javax.ejb.Handle;
-import javax.transaction.TransactionManager;
+import javax.management.ObjectName;
import org.apache.geronimo.core.service.Interceptor;
import org.apache.geronimo.core.service.Invocation;
import org.apache.geronimo.core.service.InvocationResult;
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoFactory;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.WaitingException;
import org.apache.geronimo.transaction.TrackedConnectionAssociator;
import org.apache.geronimo.transaction.UserTransactionImpl;
-
+import org.apache.geronimo.transaction.context.TransactionContextManager;
+import org.apache.geronimo.timer.ThreadPooledTimer;
+import org.apache.geronimo.kernel.Kernel;
import org.openejb.cache.InstancePool;
import org.openejb.client.EJBObjectHandler;
import org.openejb.client.EJBObjectProxy;
import org.openejb.dispatch.InterfaceMethodSignature;
+import org.openejb.dispatch.SystemMethodIndices;
import org.openejb.proxy.EJBProxyFactory;
import org.openejb.proxy.ProxyInfo;
+import org.openejb.timer.TimerServiceImpl;
/**
* @version $Revision$ $Date$
*/
-public class GenericEJBContainer implements EJBContainer {
+public class GenericEJBContainer implements EJBContainer, GBeanLifecycle {
private final ClassLoader classLoader;
private final Object containerId;
private final String ejbName;
@@ -86,6 +93,8 @@
private final String[] jndiNames;
private final String[] localJndiNames;
+ private final TimerServiceImpl timerService;
+
public GenericEJBContainer(
Object containerId,
@@ -98,8 +107,11 @@
UserTransactionImpl userTransaction,
String[] jndiNames,
String[] localJndiNames,
- TransactionManager transactionManager,
- TrackedConnectionAssociator trackedConnectionAssociator) throws
Exception {
+ TransactionContextManager transactionContextManager,
+ TrackedConnectionAssociator trackedConnectionAssociator,
+ ThreadPooledTimer timer,
+ String objectName,
+ Kernel kernel) throws Exception {
assert (containerId != null);
assert (ejbName != null && ejbName.length() > 0);
@@ -108,7 +120,7 @@
assert (jndiNames != null);
assert (localJndiNames != null);
assert (pool != null);
- assert (transactionManager != null);
+ assert (transactionContextManager != null);
this.classLoader = Thread.currentThread().getContextClassLoader();
assert (classLoader != null);
@@ -125,20 +137,26 @@
// give the contextFactory a reference to the proxyFactory
// after this there is no reason to hold on to a reference to the
contextFactory
contextFactory.setProxyFactory(proxyFactory);
- contextFactory.setSignatures(getSignatures());
+ SystemMethodIndices systemMethodIndices =
contextFactory.setSignatures(getSignatures());
// build the interceptor chain
- interceptorBuilder.setTransactionManager(transactionManager);
+ interceptorBuilder.setTransactionContextManager(transactionContextManager);
interceptorBuilder.setTrackedConnectionAssociator(trackedConnectionAssociator);
interceptorBuilder.setInstancePool(pool);
TwoChains chains = interceptorBuilder.buildInterceptorChains();
interceptor = chains.getUserChain();
contextFactory.setSystemChain(chains.getSystemChain());
+ if (timer != null) {
+ timerService = new TimerServiceImpl(systemMethodIndices, interceptor,
timer, objectName, kernel.getKernelName(), ObjectName.getInstance(objectName),
transactionContextManager);
+ contextFactory.setTimerService(timerService);
+ } else {
+ timerService = null;
+ }
// initialize the user transaction
if (userTransaction != null) {
- userTransaction.setUp(transactionManager, trackedConnectionAssociator);
+ userTransaction.setUp(transactionContextManager,
trackedConnectionAssociator);
}
// TODO maybe there is a more suitable place to do this. Maybe not.
@@ -248,12 +266,28 @@
return copy;
}
- public EJBContainer getUnmanagedReference(){
+ public EJBContainer getUnmanagedReference() {
return this;
}
+ public void doStart() throws WaitingException, Exception {
+ if (timerService != null) {
+ timerService.doStart();
+ }
+ }
+
+ public void doStop() {
+ if (timerService != null) {
+ timerService.doStop();
+ }
+ }
+
+ public void doFail() {
+ doStop();
+ }
+
private static String[] copyNames(String[] names) {
- if(names == null) {
+ if (names == null) {
return null;
}
int length = names.length;
@@ -277,38 +311,46 @@
static {
GBeanInfoFactory infoFactory = new
GBeanInfoFactory(GenericEJBContainer.class);
- infoFactory.addAttribute("ContainerID", Object.class, true);
- infoFactory.addAttribute("EJBName", String.class, true);
- infoFactory.addAttribute("ProxyInfo", ProxyInfo.class, true);
- infoFactory.addAttribute("Signatures", InterfaceMethodSignature[].class,
true);
- infoFactory.addAttribute("ContextFactory", InstanceContextFactory.class,
true);
- infoFactory.addAttribute("InterceptorBuilder", InterceptorBuilder.class,
true);
- infoFactory.addAttribute("Pool", InstancePool.class, true);
- infoFactory.addAttribute("UserTransaction", UserTransactionImpl.class,
true);
- infoFactory.addAttribute("JndiNames", String[].class, true);
- infoFactory.addAttribute("LocalJndiNames", String[].class, true);
+ infoFactory.addAttribute("containerID", Object.class, true);
+ infoFactory.addAttribute("ejbName", String.class, true);
+ infoFactory.addAttribute("proxyInfo", ProxyInfo.class, true);
+ infoFactory.addAttribute("signatures", InterfaceMethodSignature[].class,
true);
+ infoFactory.addAttribute("contextFactory", InstanceContextFactory.class,
true);
+ infoFactory.addAttribute("interceptorBuilder", InterceptorBuilder.class,
true);
+ infoFactory.addAttribute("pool", InstancePool.class, true);
+ infoFactory.addAttribute("userTransaction", UserTransactionImpl.class,
true);
+ infoFactory.addAttribute("jndiNames", String[].class, true);
+ infoFactory.addAttribute("localJndiNames", String[].class, true);
- infoFactory.addReference("TransactionManager", TransactionManager.class);
+ infoFactory.addReference("TransactionContextManager",
TransactionContextManager.class);
infoFactory.addReference("TrackedConnectionAssociator",
TrackedConnectionAssociator.class);
+ infoFactory.addReference("Timer", ThreadPooledTimer.class);
+
+ infoFactory.addAttribute("objectName", String.class, false);
+ infoFactory.addAttribute("kernel", Kernel.class, false);
- infoFactory.addAttribute("ProxyFactory", EJBProxyFactory.class, false);
- infoFactory.addAttribute("EJBHome", EJBHome.class, false);
- infoFactory.addAttribute("EJBLocalHome", EJBLocalHome.class, false);
- infoFactory.addAttribute("UnmanagedReference", EJBContainer.class, false);
+
+ infoFactory.addAttribute("proxyFactory", EJBProxyFactory.class, false);
+ infoFactory.addAttribute("ejbHome", EJBHome.class, false);
+ infoFactory.addAttribute("ejbLocalHome", EJBLocalHome.class, false);
+ infoFactory.addAttribute("unmanagedReference", EJBContainer.class, false);
infoFactory.setConstructor(new String[]{
- "ContainerID",
- "EJBName",
- "ProxyInfo",
- "Signatures",
- "ContextFactory",
- "InterceptorBuilder",
- "Pool",
- "UserTransaction",
- "JndiNames",
- "LocalJndiNames",
- "TransactionManager",
- "TrackedConnectionAssociator"});
+ "containerID",
+ "ejbName",
+ "proxyInfo",
+ "signatures",
+ "contextFactory",
+ "interceptorBuilder",
+ "pool",
+ "userTransaction",
+ "jndiNames",
+ "localJndiNames",
+ "TransactionContextManager",
+ "TrackedConnectionAssociator",
+ "Timer",
+ "objectName",
+ "kernel"});
GBEAN_INFO = infoFactory.getBeanInfo();
}
@@ -317,4 +359,5 @@
public static GBeanInfo getGBeanInfo() {
return GBEAN_INFO;
}
+
}
1.5 +6 -2
openejb/modules/core/src/java/org/openejb/InstanceContextFactory.java
Index: InstanceContextFactory.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/InstanceContextFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- InstanceContextFactory.java 7 Jul 2004 22:17:32 -0000 1.4
+++ InstanceContextFactory.java 18 Jul 2004 22:32:19 -0000 1.5
@@ -52,6 +52,8 @@
import org.openejb.proxy.EJBProxyFactory;
import org.openejb.dispatch.InterfaceMethodSignature;
+import org.openejb.dispatch.SystemMethodIndices;
+import org.openejb.timer.TimerServiceImpl;
/**
@@ -66,5 +68,7 @@
void setSystemChain(Interceptor lifecycleInterceptorChain);
- void setSignatures(InterfaceMethodSignature[] signatures);
+ SystemMethodIndices setSignatures(InterfaceMethodSignature[] signatures);
+
+ void setTimerService(TimerServiceImpl timerService);
}
1.7 +7 -10
openejb/modules/core/src/java/org/openejb/InterceptorBuilder.java
Index: InterceptorBuilder.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/InterceptorBuilder.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- InterceptorBuilder.java 7 Jul 2004 22:17:32 -0000 1.6
+++ InterceptorBuilder.java 18 Jul 2004 22:32:19 -0000 1.7
@@ -17,21 +17,18 @@
package org.openejb;
import java.io.Serializable;
-import java.util.Set;
import javax.security.auth.Subject;
-import javax.transaction.TransactionManager;
import org.apache.geronimo.naming.java.ReadOnlyContext;
import org.apache.geronimo.transaction.TrackedConnectionAssociator;
-import org.apache.geronimo.core.service.Interceptor;
-
-import org.openejb.dispatch.VirtualOperation;
-import org.openejb.transaction.TransactionPolicyManager;
-import org.openejb.security.PermissionManager;
-import org.openejb.cache.InstancePool;
+import org.apache.geronimo.transaction.context.TransactionContextManager;
import org.openejb.cache.InstanceCache;
import org.openejb.cache.InstanceFactory;
+import org.openejb.cache.InstancePool;
+import org.openejb.dispatch.VirtualOperation;
+import org.openejb.security.PermissionManager;
+import org.openejb.transaction.TransactionPolicyManager;
/**
*
@@ -57,7 +54,7 @@
void setSecurityEnabled(boolean securityEnabled);
- void setTransactionManager(TransactionManager transactionManager);
+ void setTransactionContextManager(TransactionContextManager
transactionContextManager);
void setTrackedConnectionAssociator(TrackedConnectionAssociator
trackedConnectionAssociator);
1.3 +13 -13 openejb/modules/core/src/java/org/openejb/OpenEJB.java
Index: OpenEJB.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/OpenEJB.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- OpenEJB.java 14 Apr 2004 04:21:05 -0000 1.2
+++ OpenEJB.java 18 Jul 2004 22:32:19 -0000 1.3
@@ -107,7 +107,7 @@
* Only one OpenEJB instance can be constructed in the lifetime of a VM
* process.
* <p>
- *
+ *
* @version 0.1, 3/21/2000
* @since JDK 1.2
* @see org.openejb.EnvProps
@@ -144,11 +144,11 @@
checkInitailizationState();
checkAppServer(appServer);
-
+
printStartupBanner();
loadInitProps(initProps);
-
+
SafeToolkit toolkit = SafeToolkit.getToolkit("OpenEJB");
@@ -170,9 +170,9 @@
logger.i18n.fatal( msg );
throw new OpenEJBException( msg );
} else {
- logger.i18n.debug( "startup.transactionManager",
transactionManager.getClass().getName() );
+ logger.i18n.debug( "startup.transactionContextManager",
transactionManager.getClass().getName() );
}
-
+
try {
assembler.build();
} catch ( OpenEJBException oe ){
@@ -190,7 +190,7 @@
logger.i18n.fatal( msg );
throw new OpenEJBException( msg );
}
-
+
if (logger.isDebugEnabled()) {
logger.i18n.debug(
"startup.debugContainers",
@@ -361,12 +361,12 @@
/**
* Gets the <code>TransactionManager</code> that this container manager
* exposes to the <code>Container</code> s it manages.
- *
+ *
* @return the TransactionManager to be used by this container manager's
* containers when servicing beans
* @see "javax.transaction.TransactionManager"
* @see org.openejb.spi.TransactionService#getTransactionManager()
- * TransactionService.getTransactionManager()
+ * TransactionService.getTransactionContextManager()
*/
public static TransactionManager getTransactionManager() {
return transactionManager;
@@ -375,7 +375,7 @@
/**
* Gets the <code>SecurityService</code> that this container manager
* exposes to the <code>Container</code> s it manages.
- *
+ *
* @return the SecurityService to be used by this container manager's
* containers when servicing beans
* @see org.openejb.spi.SecurityService
@@ -391,10 +391,10 @@
public static void setApplicationServer(ApplicationServer appServer) {
applicationServer = appServer;
}
-
+
/**
* Gets all the <code>Container</code> s in this container system.
- *
+ *
* @return an array of all the Containers
* @see Container
* @see ContainerManager#containers() ContainerManager.containers()
@@ -416,7 +416,7 @@
* bound using their deployment-id under the java:openejb/ejb/ namespace.
* For example, an enterprise bean with the deployment id = 55555 would be
* have its EJBHome bound to the name "java:openejb/ejb/55555"
- *
+ *
* @return the global JNDI context
*/
public static javax.naming.Context getJNDIContext() {