org.jboss.seam.cron.spi.asynchronous
Class Invoker

java.lang.Object
  extended by org.jboss.seam.cron.spi.asynchronous.Invoker

public class Invoker
extends Object

This class handles the invocation of the #Asynchronous method, unwrapping of the results out of a "dummy" #AsyncResult if necessary, and firing post-execution events with the results if any. It is designed as a managed bean to be instantiated via #@Inject Instance<Invoker>.

Author:
Peter Royle

Constructor Summary
Invoker()
           
 
Method Summary
 Object executeInvocationContext()
          Execute the #InvocationContext, unwrap the results from their #AsyncResult if necessary and fire a post-execution event.
 void setInvocationContext(InvocationContext ic)
           
protected  void setPopResultsFromFuture(boolean popResultsFromFuture)
          Set to true if the #InvocationContext returns a "dummy" #Future.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Invoker

public Invoker()
Method Detail

setInvocationContext

public void setInvocationContext(InvocationContext ic)
Parameters:
ic - The #InvocationContext which will be executed.

setPopResultsFromFuture

protected void setPopResultsFromFuture(boolean popResultsFromFuture)
Set to true if the #InvocationContext returns a "dummy" #Future. In that case we need to explicitly pop the return value out of it as it will have already been wrapped in an #AsyncResult by the #AsynchronousInterceptor.

Parameters:
popResultsFromFuture -

executeInvocationContext

public Object executeInvocationContext()
                                throws Exception
Execute the #InvocationContext, unwrap the results from their #AsyncResult if necessary and fire a post-execution event.

Returns:
The result of the method invocation, unwrapped if #popResultsFromFuture is true (ie: the return type of the method is a #Future).
Throws:
Exception - Includes any exception thrown by the invoked method.


Copyright © 2011 Seam Framework. All Rights Reserved.