fulmine.event
Interface IEventManager

All Superinterfaces:
IDestroyable, ILifeCycle
All Known Subinterfaces:
IFrameworkContext, IFulmineContext
All Known Implementing Classes:
FTContext, FulmineContext

public interface IEventManager
extends ILifeCycle

Manages events within a local context.

Author:
Ramon Servadei
See Also:
IFrameworkContext

Method Summary
 void execute(Runnable task)
          Add the task to a queue to be executed by a single worker thread.
 int getEventProcessorCount()
          Get the number of EventProcessor instances in this context
 ThreadGroup getEventProcessorThreadGroup()
          Get the ThreadGroup for the event processors.
 ISystemEventSource getSystemEventSource(Class<? extends ISystemEvent> type)
          Get an ISystemEventSource that is used to propagate a single specific type of ISystemEvent.
 void queueEvent(IEvent event)
          Add the event to a queue for distribution to registered IEventListener instances for the event's IEventSource.
 void queueEvents(Collection<IEvent> events)
          Bulk operation for queueing events.
 void schedule(TimerTask task, long delay, long period)
          Schedule a timer task to be executed by a single worker thread.
 
Methods inherited from interface fulmine.ILifeCycle
isActive, start
 
Methods inherited from interface fulmine.IDestroyable
destroy
 

Method Detail

getSystemEventSource

ISystemEventSource getSystemEventSource(Class<? extends ISystemEvent> type)
Get an ISystemEventSource that is used to propagate a single specific type of ISystemEvent. The system event source will be created on the first invocation. The system event source is associated with the zeroth EventProcessor.

Parameters:
type - the type of the system events the system event source generates
Returns:
the ISystemEventSource for the type of system event

queueEvents

void queueEvents(Collection<IEvent> events)
Bulk operation for queueing events.

Parameters:
event - the list of events to queue
See Also:
queueEvent(IEvent)

queueEvent

void queueEvent(IEvent event)
Add the event to a queue for distribution to registered IEventListener instances for the event's IEventSource.

Parameters:
event - the event to queue

getEventProcessorThreadGroup

ThreadGroup getEventProcessorThreadGroup()
Get the ThreadGroup for the event processors.

Returns:
the thread group for the event processors

getEventProcessorCount

int getEventProcessorCount()
Get the number of EventProcessor instances in this context

Returns:
the number of event processors in this context

execute

void execute(Runnable task)
Add the task to a queue to be executed by a single worker thread. This is provided as a utility to execute a "one-shot" asynchronous task.

Parameters:
runnable - the task to add to the execution queue

schedule

void schedule(TimerTask task,
              long delay,
              long period)
Schedule a timer task to be executed by a single worker thread.

Parameters:
task - task to be scheduled.
delay - delay in milliseconds before task is to be executed.
period - time in milliseconds between successive task executions.


Copyright © 2007-2009. All Rights Reserved.