net.sf.mmm.util.event.base
Class AbstractMultiThreadedEventSource<E extends Event,L extends EventListener<E>>
java.lang.Object
net.sf.mmm.util.component.base.AbstractComponent
net.sf.mmm.util.component.base.AbstractLoggableComponent
net.sf.mmm.util.event.base.AbstractEventSource<E,L>
net.sf.mmm.util.event.base.AbstractSynchronizedEventSource<E,L>
net.sf.mmm.util.event.base.AbstractMultiThreadedEventSource<E,L>
- Type Parameters:
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.
- All Implemented Interfaces:
- EventSource<E,L>
public abstract class AbstractMultiThreadedEventSource<E extends Event,L extends EventListener<E>>
- extends AbstractSynchronizedEventSource<E,L>
This class extends AbstractSynchronizedEventSource
with the ability
to send events asynchronous in separate Thread
s.
- Since:
- 1.0.1
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
executor
private Executor executor
- See Also:
getExecutor()
AbstractMultiThreadedEventSource
public AbstractMultiThreadedEventSource()
- The constructor.
setExecutor
@Inject
public void setExecutor(Executor threadPool)
- This method sets the
executor
to use.
- Parameters:
threadPool
- is used to dispatch events in separate threads.
getExecutor
public Executor getExecutor()
- This method gets the
Executor
used to run asynchronous tasks. It
may use a thread-pool.
- Returns:
- the executor.
doInitialize
protected void doInitialize()
- This method performs the actual
initialization
. It is
called when AbstractComponent.initialize()
is invoked for the first time.
ATTENTION:
When you override this method from a sub-class you need to do a
super.AbstractComponent.doInitialize()
.
- Overrides:
doInitialize
in class AbstractLoggableComponent
fireEvent
protected void fireEvent(E event,
L listener)
- This method sends the given
event
to the given
listener
.
- Overrides:
fireEvent
in class AbstractEventSource<E extends Event,L extends EventListener<E>>
- Parameters:
event
- the event to set.listener
- the listener that should receive the event
.
Copyright © 2001-2010 mmm-Team. All Rights Reserved.