org.asmatron.messengine
Interface ControlEngine

All Superinterfaces:
EngineController
All Known Subinterfaces:
Engine
All Known Implementing Classes:
DefaultEngine, TestEngine

public interface ControlEngine
extends EngineController

Engine for controllers and service objects.
This engine allows service tier objects to communicate with the view.


Method Summary
<T extends ActionObject>
void
addActionHandler(ActionId<T> actionId, ActionHandler<T> actionHandler)
           
 void fireEvent(EventId<EmptyEvent> eventId)
          Fires an event and allows all event listeners to handle it.
<T extends EventObject>
void
fireEvent(EventId<T> eventId, T argument)
          Fires the event with an argument passed to listeners.
<T> void
fireValueEvent(EventId<ValueEvent<T>> eventId, T argument)
          Convenience method that fires a value event (a wrapper of a simple class into an eventObject).
<T> T
get(ModelId<T> modelId)
          Gets a value from the engine model repository.
<T extends ActionObject>
void
removeActionHandler(ActionId<T> actionId)
           
<T> void
set(ModelId<T> modelId, T value, EventId<ValueEvent<T>> event)
           
 
Methods inherited from interface org.asmatron.messengine.EngineController
start, stop
 

Method Detail

fireEvent

void fireEvent(EventId<EmptyEvent> eventId)
Fires an event and allows all event listeners to handle it.
This is a convenience method that fires an emptyEvent so eventListeners does not need the event argument.

Parameters:
eventId - The id of the event (must be an EmptyEvent)

fireEvent

<T extends EventObject> void fireEvent(EventId<T> eventId,
                                       T argument)
Fires the event with an argument passed to listeners.

Type Parameters:
T - The type of the argument, it must extend the EventObject class.
Parameters:
eventId - The id of the event
argument - The argument of matching T type that will be passed to event listeners

fireValueEvent

<T> void fireValueEvent(EventId<ValueEvent<T>> eventId,
                        T argument)
Convenience method that fires a value event (a wrapper of a simple class into an eventObject).

Type Parameters:
T - Anything that we want to send to eventListeners.
Parameters:
eventId - The id of the event (must be a ValueEvent)
argument - the argument that will be wrapped on a valueEvent

get

<T> T get(ModelId<T> modelId)
Gets a value from the engine model repository.

Type Parameters:
T - The type of the value stored
Parameters:
modelId - the id of the model variable stored in the engine
Returns:
the model variable value or null if none is found

set

<T> void set(ModelId<T> modelId,
             T value,
             EventId<ValueEvent<T>> event)

addActionHandler

<T extends ActionObject> void addActionHandler(ActionId<T> actionId,
                                               ActionHandler<T> actionHandler)

removeActionHandler

<T extends ActionObject> void removeActionHandler(ActionId<T> actionId)


Copyright © 2011. All Rights Reserved.