djencks 2004/07/20 19:40:02 Modified: modules/core/src/java/org/openejb/entity/bmp BMPContainerBuilder.java BMPInstanceContext.java BMPInstanceContextFactory.java Log:
Extend timer service to entity beans Revision Changes Path 1.10 +10 -2 openejb/modules/core/src/java/org/openejb/entity/bmp/BMPContainerBuilder.java Index: BMPContainerBuilder.java =================================================================== RCS file: /home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/entity/bmp/BMPContainerBuilder.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- BMPContainerBuilder.java 18 Jul 2004 22:32:21 -0000 1.9 +++ BMPContainerBuilder.java 20 Jul 2004 23:40:02 -0000 1.10 @@ -65,6 +65,7 @@ import org.openejb.dispatch.MethodHelper; import org.openejb.dispatch.MethodSignature; import org.openejb.dispatch.VirtualOperation; +import org.openejb.dispatch.EJBTimeoutOperation; import org.openejb.entity.BusinessMethod; import org.openejb.entity.EntityInstanceFactory; import org.openejb.entity.EntityInterceptorBuilder; @@ -105,6 +106,7 @@ // build the pool InstancePool pool = createInstancePool(instanceFactory); + ObjectName timerName = getTimerName(beanClass); if (buildContainer) { @@ -140,8 +142,14 @@ // create a VirtualOperation for the method (if the method is understood) String name = beanMethod.getName(); - MethodSignature signature = new MethodSignature(beanMethod); + if (TimedObject.class.isAssignableFrom(beanClass)) { + MethodSignature signature = new MethodSignature("ejbTimeout", new Class[]{Timer.class}); + vopMap.put( + MethodHelper.translateToInterface(signature) + , EJBTimeoutOperation.INSTANCE); + } + MethodSignature signature = new MethodSignature(beanMethod); if (name.startsWith("ejbCreate")) { // ejbCreate vop needs a reference to the ejbPostCreate method MethodSignature postCreateSignature = new MethodSignature( 1.7 +3 -3 openejb/modules/core/src/java/org/openejb/entity/bmp/BMPInstanceContext.java Index: BMPInstanceContext.java =================================================================== RCS file: /home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/entity/bmp/BMPInstanceContext.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- BMPInstanceContext.java 18 Jul 2004 22:32:21 -0000 1.6 +++ BMPInstanceContext.java 20 Jul 2004 23:40:02 -0000 1.7 @@ -55,7 +55,7 @@ import org.openejb.dispatch.SystemMethodIndices; import org.openejb.entity.EntityInstanceContext; import org.openejb.proxy.EJBProxyFactory; -import org.openejb.timer.TimerServiceImpl; +import org.openejb.timer.BasicTimerService; /** * @@ -64,7 +64,7 @@ */ public final class BMPInstanceContext extends EntityInstanceContext { - public BMPInstanceContext(Object containerId, EJBProxyFactory proxyFactory, EntityBean instance, Interceptor lifecycleInterceptorChain, SystemMethodIndices systemMethodIndices, Set unshareableResources, Set applicationManagedSecurityResources, TimerServiceImpl timerService) throws Exception { + public BMPInstanceContext(Object containerId, EJBProxyFactory proxyFactory, EntityBean instance, Interceptor lifecycleInterceptorChain, SystemMethodIndices systemMethodIndices, Set unshareableResources, Set applicationManagedSecurityResources, BasicTimerService timerService) throws Exception { super(containerId, proxyFactory, instance, lifecycleInterceptorChain, systemMethodIndices, unshareableResources, applicationManagedSecurityResources, timerService); } 1.9 +4 -4 openejb/modules/core/src/java/org/openejb/entity/bmp/BMPInstanceContextFactory.java Index: BMPInstanceContextFactory.java =================================================================== RCS file: /home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/entity/bmp/BMPInstanceContextFactory.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- BMPInstanceContextFactory.java 18 Jul 2004 22:32:21 -0000 1.8 +++ BMPInstanceContextFactory.java 20 Jul 2004 23:40:02 -0000 1.9 @@ -58,7 +58,7 @@ import org.openejb.EJBInstanceFactory; import org.openejb.EJBInstanceFactoryImpl; import org.openejb.InstanceContextFactory; -import org.openejb.timer.TimerServiceImpl; +import org.openejb.timer.BasicTimerService; import org.openejb.dispatch.InterfaceMethodSignature; import org.openejb.dispatch.SystemMethodIndices; import org.openejb.proxy.EJBProxyFactory; @@ -76,7 +76,7 @@ private transient EJBProxyFactory proxyFactory; private transient Interceptor systemChain; private transient SystemMethodIndices systemMethodIndices; - private TimerServiceImpl timerService; + private BasicTimerService timerService; public BMPInstanceContextFactory(Object containerId, Class beanClass, Set unshareableResources, Set applicationManagedSecurityResources) { @@ -99,7 +99,7 @@ return systemMethodIndices; } - public void setTimerService(TimerServiceImpl timerService) { + public void setTimerService(BasicTimerService timerService) { this.timerService = timerService; }