SPEC
- The DispatcherComponentSpec subclassTARGET
- The type that this spec will createpublic abstract class DispatcherComponentSpec<SPEC extends DispatcherComponentSpec<SPEC,TARGET>,TARGET> extends Object implements Supplier<TARGET>
Environment
and Dispatcher
.Constructor and Description |
---|
DispatcherComponentSpec() |
Modifier and Type | Method and Description |
---|---|
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(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 usethis
public final SPEC defaultDispatcher()
this
IllegalStateException
- if no Environment has been configuredEnvironment.getDefaultDispatcher()
,
env(Environment)
public final SPEC synchronousDispatcher()
this
public final SPEC dispatcher(Dispatcher dispatcher)
dispatcher
dispatcher
- The dispatcher to usethis
public final SPEC dispatcher(String dispatcherName)
dispatcherName
dispatcherName
- The name of the dispatcherthis
IllegalStateException
- if no Environment has been configuredEnvironment.getDispatcher(String)
,
env(Environment)
protected abstract TARGET configure(Dispatcher dispatcher, Environment environment)
Copyright © 2016. All rights reserved.