E
- is the templated type of the events to send.L
- is the templated type of the listeners that can be registered
here and
that will receive
the sent events.public abstract class AbstractMultiThreadedEventSource<E extends Event,L extends EventListener<E>> extends AbstractSynchronizedEventSource<E,L>
AbstractSynchronizedEventSource
with the ability to send events asynchronous in separate
Thread
s.Constructor and Description |
---|
AbstractMultiThreadedEventSource()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doInitialize()
This method performs the actual
initialization . |
protected void |
fireEvent(E event,
L listener)
This method sends the given
event to the given listener . |
Executor |
getExecutor()
This method gets the
Executor used to run asynchronous tasks. |
void |
setExecutor(Executor threadPool)
This method sets the
executor to use. |
addListener, fireEvent, handleListenerError, removeListener
createLogger, getLogger
doInitialized, getInitializationState, initialize
private Executor executor
public AbstractMultiThreadedEventSource()
@Inject public void setExecutor(Executor threadPool)
executor
to use.threadPool
- is used to dispatch events in separate threads.public Executor getExecutor()
Executor
used to run asynchronous tasks. It may use a thread-pool.protected void doInitialize()
AbstractComponent
initialization
. It is called when AbstractComponent.initialize()
is
invoked for the first time. super.
AbstractComponent.doInitialize()
.doInitialize
in class AbstractLoggableComponent
protected void fireEvent(E event, L listener)
AbstractEventSource
event
to the given listener
.fireEvent
in class AbstractEventSource<E extends Event,L extends EventListener<E>>
event
- the event to set.listener
- the listener that should receive the event
.Copyright © 2001–2016 mmm-Team. All rights reserved.