dain 2005/02/14 22:24:02
Modified: modules/core/src/java/org/openejb/dispatch
SystemMethodIndices.java
Log:
o Finished GERONIMO-181 Transaction propogation accross calls to stateful
session beans
o Added code resume and suspend the BMT transaction to
StatefulInstanceInterceptor. This code must be here because the instance
context holds the suspended transaction, and this context is not available in
the transaction interceptor. Also the code that "finds" the correct instance
relies on the transaction context already being established
o Enabled stateful tests for session synchronization callbacks
o Session synchronization callbacks now go through the system interceptor
chain
o Container policies now setRollbackOnly and throw a
TransactionRolledbac[Local]Exception when a system exception is thrown in an
inherited transaction
o Fixed GERONIMO-579 UserTransaction broken after BMT calls BMT
o Added support for ejb-ql back into the openejb-jar.xml file so 1.1 beans
can use ejb-ql for a query specification
o Fixed client side handle serialization code
o Fixed stateful session ejb object isIdentical code; was not comparing
primary key
o Fixed handling of remove methods
Revision Changes Path
1.5 +28 -3
openejb/modules/core/src/java/org/openejb/dispatch/SystemMethodIndices.java
Index: SystemMethodIndices.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/dispatch/SystemMethodIndices.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SystemMethodIndices.java 26 Jan 2005 23:27:59 -0000 1.4
+++ SystemMethodIndices.java 15 Feb 2005 03:24:02 -0000 1.5
@@ -71,6 +71,9 @@
private final int ejbTimeout;
private final int setContext;
private final int unsetContext;
+ private final int afterBegin;
+ private final int beforeCompletion;
+ private final int afterCompletion;
public static SystemMethodIndices
createSystemMethodIndices(InterfaceMethodSignature[] signatures, String
setContextName, String setContextType, String unsetContextName) {
int ejbActivate = -1;
@@ -82,6 +85,9 @@
int ejbRemove = -1;
int setContext = -1;
int unsetContext = -1;
+ int afterBegin = -1;
+ int beforeCompletion = -1;
+ int afterCompletion = -1;
for (int i = 0; i < signatures.length; i++) {
InterfaceMethodSignature signature = signatures[i];
if (signature.getMethodName().equals("ejbActivate")) {
@@ -102,12 +108,18 @@
setContext = i;
} else if (signature.getMethodName().equals(unsetContextName) &&
signature.getParameterTypes().length == 0) {
unsetContext = i;
+ } else if (signature.getMethodName().equals("afterBegin") &&
signature.getParameterTypes().length == 0 && !signature.isHomeMethod() ) {
+ afterBegin = i;
+ } else if (signature.getMethodName().equals("beforeCompletion")
&& signature.getParameterTypes().length == 0 && !signature.isHomeMethod() ) {
+ beforeCompletion = i;
+ } else if (signature.getMethodName().equals("afterCompletion")
&& signature.getParameterTypes().length == 1 && !signature.isHomeMethod() &&
signature.getParameterTypes()[0].equals(boolean.class.getName())) {
+ afterCompletion = i;
}
}
- return new SystemMethodIndices(ejbActivate, ejbLoad, ejbPassivate,
ejbStore, ejbTimeout, ejbCreate, ejbRemove, setContext, unsetContext);
+ return new SystemMethodIndices(ejbActivate, ejbLoad, ejbPassivate,
ejbStore, ejbTimeout, ejbCreate, ejbRemove, setContext, unsetContext,
afterBegin, beforeCompletion, afterCompletion);
}
- public SystemMethodIndices(int ejbActivate, int ejbLoad, int
ejbPassivate, int ejbStore, int ejbTimeout, int ejbCreate, int ejbRemove, int
setContext, int unsetContext) {
+ public SystemMethodIndices(int ejbActivate, int ejbLoad, int
ejbPassivate, int ejbStore, int ejbTimeout, int ejbCreate, int ejbRemove, int
setContext, int unsetContext, int afterBegin, int beforeCompletion, int
afterCompletion) {
this.ejbActivate = ejbActivate;
this.ejbLoad = ejbLoad;
this.ejbPassivate = ejbPassivate;
@@ -117,6 +129,9 @@
this.ejbRemove = ejbRemove;
this.setContext = setContext;
this.unsetContext = unsetContext;
+ this.afterBegin = afterBegin;
+ this.beforeCompletion = beforeCompletion;
+ this.afterCompletion = afterCompletion;
}
public EJBInvocation getEjbActivateInvocation(EJBInstanceContext
instanceContext) {
@@ -156,5 +171,15 @@
return new EJBInvocationImpl(unsetContext, null, instanceContext);
}
+ public EJBInvocation getAfterBeginInvocation(EJBInstanceContext
instanceContext) {
+ return new EJBInvocationImpl(afterBegin, null, instanceContext);
+ }
+
+ public EJBInvocation getBeforeCompletionInvocation(EJBInstanceContext
instanceContext) {
+ return new EJBInvocationImpl(beforeCompletion, null,
instanceContext);
+ }
+ public EJBInvocation getAfterCompletionInvocation(EJBInstanceContext
instanceContext, boolean comitted) {
+ return new EJBInvocationImpl(afterCompletion, new
Object[]{Boolean.valueOf(comitted)}, instanceContext);
+ }
}