Author: norman.richards(a)jboss.com
Date: 2009-03-02 13:47:07 -0500 (Mon, 02 Mar 2009)
New Revision: 10105
Modified:
trunk/src/main/org/jboss/seam/async/AsynchronousInterceptor.java
Log:
JBSEAM-3982
Modified: trunk/src/main/org/jboss/seam/async/AsynchronousInterceptor.java
===================================================================
--- trunk/src/main/org/jboss/seam/async/AsynchronousInterceptor.java 2009-03-02 16:31:34
UTC (rev 10104)
+++ trunk/src/main/org/jboss/seam/async/AsynchronousInterceptor.java 2009-03-02 18:47:07
UTC (rev 10105)
@@ -40,25 +40,22 @@
Object timer = dispatcher.scheduleInvocation( invocation, getComponent() );
//if the method returns a Timer, return it to the client
return timer!=null &&
invocation.getMethod().getReturnType().isAssignableFrom( timer.getClass() ) ? timer :
null;
- }
- else
- {
- if (isExecutingAsynchronousCall())
- {
- Contexts.getEventContext().set(REENTRANT, true);
- }
- try
- {
- return invocation.proceed();
- }
- finally
- {
- if (isExecutingAsynchronousCall())
- {
- Contexts.getEventContext().remove(REENTRANT);
- }
- }
- }
+ } else {
+
+ boolean setFlag = false;
+ if (isExecutingAsynchronousCall()) {
+ Contexts.getEventContext().set(REENTRANT, true);
+ setFlag = true;
+ }
+
+ try {
+ return invocation.proceed();
+ } finally {
+ if (setFlag) {
+ Contexts.getEventContext().remove(REENTRANT);
+ }
+ }
+ }
}
private boolean isExecutingAsynchronousCall()
Show replies by date