djencks 2005/02/14 13:32:25
Modified: modules/core/src/java/org/openejb/dispatch
AbstractMethodOperation.java
AbstractSpecificMethodOperation.java
Log:
implement the amazing rules on when getTimerService() and the TimerService
and Timer methods are available
Revision Changes Path
1.4 +4 -1
openejb/modules/core/src/java/org/openejb/dispatch/AbstractMethodOperation.java
Index: AbstractMethodOperation.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/dispatch/AbstractMethodOperation.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AbstractMethodOperation.java 25 May 2004 21:21:07 -0000 1.3
+++ AbstractMethodOperation.java 14 Feb 2005 18:32:25 -0000 1.4
@@ -61,6 +61,7 @@
import org.openejb.EJBInstanceContext;
import org.openejb.EJBInvocation;
import org.openejb.EJBOperation;
+import org.openejb.timer.TimerState;
/**
*
@@ -82,6 +83,7 @@
protected InvocationResult invoke(EJBInvocation invocation, EJBOperation
operation) throws Throwable {
EJBInstanceContext ctx = invocation.getEJBInstanceContext();
+ boolean oldTimerMethodAvailable = ctx.setTimerState(operation);
try {
ctx.setOperation(operation);
try {
@@ -98,6 +100,7 @@
}
} finally {
ctx.setOperation(EJBOperation.INACTIVE);
+ TimerState.setTimerState(oldTimerMethodAvailable);
}
}
1.2 +4 -1
openejb/modules/core/src/java/org/openejb/dispatch/AbstractSpecificMethodOperation.java
Index: AbstractSpecificMethodOperation.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/dispatch/AbstractSpecificMethodOperation.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractSpecificMethodOperation.java 7 Jul 2004 22:17:32 -0000
1.1
+++ AbstractSpecificMethodOperation.java 14 Feb 2005 18:32:25 -0000
1.2
@@ -63,6 +63,7 @@
import org.openejb.EJBInstanceContext;
import org.openejb.EJBInvocation;
import org.openejb.EJBOperation;
+import org.openejb.timer.TimerState;
/**
*
@@ -73,6 +74,7 @@
protected InvocationResult invoke(EJBInvocation invocation, EJBOperation
operation) throws Throwable {
EJBInstanceContext ctx = invocation.getEJBInstanceContext();
+ boolean oldTimerMethodAvailable = ctx.setTimerState(operation);
try {
ctx.setOperation(operation);
try {
@@ -88,6 +90,7 @@
}
} finally {
ctx.setOperation(EJBOperation.INACTIVE);
+ TimerState.setTimerState(oldTimerMethodAvailable);
}
}