|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.commandhandling.SimpleCommandBus org.axonframework.commandhandling.AsynchronousCommandBus
public class AsynchronousCommandBus
Specialization of the SimpleCommandBus that processed Commands asynchronously from the calling thread. By default,
the AsynchronousCommandBus uses a Cached Thread Pool (see
Executors.newCachedThreadPool()
). It will reuse threads while possible, and shut them
down after 60 seconds of inactivity.
shutdown()
to stop any threads waiting for new tasks. Failure to do so may cause
the JVM to hang for up to 60 seconds on JVM shutdown.
Constructor Summary | |
---|---|
AsynchronousCommandBus()
Initialize the AsynchronousCommandBus, using a Cached Thread Pool. |
|
AsynchronousCommandBus(Executor executor)
Initialize the AsynchronousCommandBus using the given executor . |
Method Summary | ||
---|---|---|
protected
|
doDispatch(CommandMessage<?> command,
CommandCallback<R> callback)
Performs the actual dispatching logic. |
|
void |
shutdown()
Shuts down the Executor used to asynchronously dispatch incoming commands. |
Methods inherited from class org.axonframework.commandhandling.SimpleCommandBus |
---|
dispatch, dispatch, intercept, setDispatchInterceptors, setHandlerInterceptors, setRollbackConfiguration, setSubscriptions, setTransactionManager, setUnitOfWorkFactory, subscribe, unsubscribe |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AsynchronousCommandBus()
public AsynchronousCommandBus(Executor executor)
executor
.
executor
- The executor that processes Command dispatching threadsMethod Detail |
---|
protected <R> void doDispatch(CommandMessage<?> command, CommandCallback<R> callback)
SimpleCommandBus
doDispatch
in class SimpleCommandBus
R
- The type of result expected from the command handlercommand
- The actual command to dispatch to the handlercallback
- The callback to notify of the resultpublic void shutdown()
Executor
provided
in the constructor does not implement ExecutorService
, this method does nothing.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |