|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ActiveComponent
An active component can be any component used by or attached to an event listener that maintains a configurable internal state that may be sensitive to the lifecycle of the event dispatcher, and that actively performs work during delivery of the event stream.
By implementing this interface, a component provides hooks that are used by event dispatchers to supply system global resources and opportunities for the component to configure itself and report whether it is ready for the initiation of the event stream.
Method Summary | |
---|---|
java.util.List |
configure(java.util.List parameters)
Configures this component from command line parameters. |
boolean |
isReady()
Reports whether this component is ready for the event dispatcher to begin dispatching events. |
void |
register(EventDispatcherConfiguration edConfig)
Registers this component with the event dispatcher. |
void |
release()
Notifies this component that its current lifecycle has expired and that it should commit any stored state and release resources. |
void |
reset()
Notifies this component to clear its configuration and reset any internal state. |
Method Detail |
---|
void register(EventDispatcherConfiguration edConfig)
Registers this component with the event dispatcher.
This method is called each time an event dispatcher prepares to
initiate a new event stream, caused by a call to
ProgramEventDispatcher.startDispatcher()
.
edConfig
- The current configuration of system global resources
and settings that the component may (and should) use as appropriate.java.util.List configure(java.util.List parameters)
Configures this component from command line parameters.
This method provides a component the opportunity to define and process command line parameters required to configure itself. Components participate in a processing chain, initiated in Sofya-provided event dispatchers by calling this method on the processing strategy. The processing strategies provided by Sofya in turn invoke this method on any listeners implementing this interface.
parameters
- A list of command line tokens that have not yet
been processed by any previous components.
ParameterValueAbsentException
- If a required value for a
recognized parameter is not provided.
BadParameterValueException
- If a value for a recognized
parameter is invalid.void reset() throws java.lang.IllegalStateException
Notifies this component to clear its configuration and reset any internal state.
Calls to this method are chained similary to the configure(java.util.List)
method. This method is invoked by the event dispatcher prior to
reconfiguration. Normally it should be used to clear any configuration
state to avoid using stale values.
java.lang.IllegalStateException
- If it is impossible for this component
to reset its configuration or internal state at the time of the
request.boolean isReady()
Reports whether this component is ready for the event dispatcher to begin dispatching events.
Calls to this method are chained similarly to the configure(java.util.List)
method. The event dispatcher will fail with an error if a client
invokes ProgramEventDispatcher.startDispatcher()
when any
attached component returns false
from this method.
true
if this component is ready for the event
dispatcher to begin dispatching events, false
otherwise.void release()
Notifies this component that its current lifecycle has expired and that it should commit any stored state and release resources.
Calls to this method are chained similary to the configure(java.util.List)
method. This method is invoked directly by a client of the event
dispatcher. Normally, it should be used to release any resources that
were required to persist over multiple runs of the event dispatcher.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |