[jboss-cvs] jboss-seam/src/main/org/jboss/seam/interceptors ...
Gavin King
gavin.king at jboss.com
Mon Oct 30 11:54:34 EST 2006
User: gavin
Date: 06/10/30 11:54:34
Modified: src/main/org/jboss/seam/interceptors
AsynchronousInterceptor.java
Log:
minor improvs
Revision Changes Path
1.6 +7 -1 jboss-seam/src/main/org/jboss/seam/interceptors/AsynchronousInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: AsynchronousInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/interceptors/AsynchronousInterceptor.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- AsynchronousInterceptor.java 22 Oct 2006 22:37:02 -0000 1.5
+++ AsynchronousInterceptor.java 30 Oct 2006 16:54:34 -0000 1.6
@@ -9,6 +9,7 @@
import org.jboss.seam.annotations.Interceptor;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.Dispatcher;
+import org.jboss.seam.core.LocalDispatcher;
@Interceptor(type=InterceptorType.CLIENT)
public class AsynchronousInterceptor extends AbstractInterceptor
@@ -20,7 +21,12 @@
!Contexts.getEventContext().isSet(Dispatcher.EXECUTING_ASYNCHRONOUS_CALL);
if (scheduleAsync)
{
- Timer timer = Dispatcher.instance().scheduleInvocation(invocation, getComponent());
+ LocalDispatcher dispatcher = Dispatcher.instance();
+ if (dispatcher==null)
+ {
+ throw new IllegalStateException("Dispatcher is not installed in components.xml");
+ }
+ Timer timer = dispatcher.scheduleInvocation(invocation, getComponent());
//if the method returns a Timer, return it to the client
return invocation.getMethod().getReturnType().equals(Timer.class) ? timer : null;
}
More information about the jboss-cvs-commits
mailing list