SPEC - The DispatcherComponentSpec subclassTARGET - The type that this spec will createpublic abstract class DispatcherComponentSpec<SPEC extends DispatcherComponentSpec<SPEC,TARGET>,TARGET> extends java.lang.Object implements Supplier<TARGET>
Environment and Dispatcher.| Constructor and Description |
|---|
DispatcherComponentSpec() |
| Modifier and Type | Method and Description |
|---|---|
SPEC |
actorSystem(Function<java.lang.Object,Dispatcher> actorMapper)
Configures the component to use an ActorDispatcher.
|
SPEC |
actorSystem(java.lang.String name)
Configures the component to use an Environment based ActorDispatcher.
|
protected abstract TARGET |
configure(Dispatcher dispatcher,
Environment environment) |
SPEC |
defaultDispatcher()
Configures the component to use the configured Environment's default dispatcher
|
SPEC |
dispatcher(Dispatcher dispatcher)
Configures the component to use the given
dispatcher |
SPEC |
dispatcher(java.lang.String dispatcherName)
Configures the component to the dispatcher in the configured Environment with the given
dispatcherName |
SPEC |
env(Environment env)
Configures the spec, and potentially the component being configured, to use the given
environment
|
TARGET |
get()
Get an object.
|
SPEC |
synchronousDispatcher()
Configures the component to use a synchronous dispatcher
|
public final SPEC env(Environment env)
env - The environment to usethispublic final SPEC actorSystem(java.lang.String name)
Environment.getDispatcher(String), returning a new dispatcher from the pool using round robin selection.name - The dispatcher to usethisjava.lang.IllegalStateException - if no Environment has been configuredEnvironment.getDefaultDispatcher(),
env(Environment)public final SPEC actorSystem(Function<java.lang.Object,Dispatcher> actorMapper)
actorMapper - The dispatcher to usethisjava.lang.IllegalStateException - if no Environment has been configuredEnvironment.getDefaultDispatcher(),
env(Environment)public final SPEC defaultDispatcher()
thisjava.lang.IllegalStateException - if no Environment has been configuredEnvironment.getDefaultDispatcher(),
env(Environment)public final SPEC synchronousDispatcher()
thispublic final SPEC dispatcher(Dispatcher dispatcher)
dispatcherdispatcher - The dispatcher to usethispublic final SPEC dispatcher(java.lang.String dispatcherName)
dispatcherNamedispatcherName - The name of the dispatcherthisjava.lang.IllegalStateException - if no Environment has been configuredEnvironment.getDispatcher(String),
env(Environment)protected abstract TARGET configure(Dispatcher dispatcher, Environment environment)