Creates a # {@link Callable} whose #{@literal call} method will block until the # {@literal executeInvocationContext()} method is called. This comes inhandy when returning Futures (eg: # {@literal new FutureTask(new FutureInvokerSupport(invoker))}).
In the simplest case # {@literal executeInvocationContext()} could be called in the same thread prior to calling # {@literal call()}. This is useful when your method of executing in the background is also # {@link Runnable} or # {@link Callable} and can thus be used to return a #{@link RunnableFuture}.
In more complex cases # {@literal executeInvocationContext()} could be called by a separate thread at any time before or after the current thread calls # {@literal call()}. This is useful when your method of executing in the background is fairly arbitrary (eg a Quartz Job scheduled for the near future), and you need to be able to return a # {@literal new FutureTask(callable)} immediatelybut trigger the processing on that callable some arbitrary way (ie: inside the Quartz Job implementation).
See the Seam Cron Asynchronous Provider projects for the Threads and Quartz providers to see this in action (providers/scheduling/quartz and providers/asynchronous/threads).
@author peteroyle
|
|
|
|
|
|
|
|