User: simone
Date: 01/03/11 09:02:39
Modified: src/main/org/jboss/ejb/plugins
StatefulSessionInstanceInterceptor.java
Log:
Added afterBegin implementation.
Thanks to Laurent ([EMAIL PROTECTED]) for this patch.
Revision Changes Path
1.15 +23 -4
jboss/src/main/org/jboss/ejb/plugins/StatefulSessionInstanceInterceptor.java
Index: StatefulSessionInstanceInterceptor.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/StatefulSessionInstanceInterceptor.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- StatefulSessionInstanceInterceptor.java 2000/12/12 09:47:34 1.14
+++ StatefulSessionInstanceInterceptor.java 2001/03/11 17:02:39 1.15
@@ -34,7 +34,7 @@
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
-* @version $Revision: 1.14 $
+* @version $Revision: 1.15 $
*/
public class StatefulSessionInstanceInterceptor
extends AbstractInterceptor
@@ -128,6 +128,9 @@
// We want to be notified when the transaction commits
tx.registerSynchronization(synch);
+ // EJB 1.1, 6.5.3
+ synch.afterBegin();
+
} catch (RollbackException e) {
} catch (Exception e) {
@@ -280,10 +283,12 @@
private EnterpriseContext ctx;
// a utility boolean for session sync
- boolean notifySession = false;
+ private boolean notifySession = false;
// Utility methods for the notifications
- Method beforeCompletion, afterCompletion;
+ private Method afterBegin;
+ private Method beforeCompletion;
+ private Method afterCompletion;
/**
@@ -304,8 +309,8 @@
Class sync =
Class.forName("javax.ejb.SessionSynchronization");
// Lookup the methods on it
+ afterBegin = sync.getMethod("afterBegin", new
Class[0]);
beforeCompletion =
sync.getMethod("beforeCompletion", new Class[0]);
-
afterCompletion =
sync.getMethod("afterCompletion", new Class[] {boolean.class});
}
catch (Exception e) { Logger.exception(e);}
@@ -313,6 +318,20 @@
}
// Synchronization implementation -----------------------------
+ public void afterBegin()
+ {
+ if (notifySession)
+ {
+ try
+ {
+ afterBegin.invoke(ctx.getInstance(), new
Object[0]);
+ }
+ catch (Exception x)
+ {
+ Logger.exception(x);
+ }
+ }
+ }
public void beforeCompletion()
{