com.tomgibara.pronto.control
Interface Controller<S,L,P>

Type Parameters:
S - the type of state supported on the state engine for the controller
L - the type of label supported on the state engine for the controller
P - the type of parameter supported on the state engine for the controller
All Known Implementing Classes:
ControllerImpl

public interface Controller<S,L,P>

A Controller manipulates a state engine in response to events in an application's environment. Implementations of this interface are produced by the control factory.

Author:
Tom Gibara

Method Summary
 EngineControlAdapter<S,L,P> getAdapter()
          The adapter that is being used by the controller to mediate external events and the state graph.
 com.tomgibara.pronto.state.StateEngine<S,L,P> getEngine()
          The engine through which this controller operates.
 void start()
          Starts the controller.
 boolean stop(long timeout)
          Stops the controller.
 

Method Detail

start

void start()
Starts the controller. If the controller has already been started, no action is taken.


stop

boolean stop(long timeout)
Stops the controller. If the controller has already been stopped, or has not yet been started, the method returns immediately with the value true.

Parameters:
timeout - the number of milliseconds that the calling thread is willing to wait for stoppage to occur, 0L waits indefinitely.
Returns:
true if the controller is not running, false otherwise.

getEngine

com.tomgibara.pronto.state.StateEngine<S,L,P> getEngine()
The engine through which this controller operates.

Returns:
the engine used by this controller

getAdapter

EngineControlAdapter<S,L,P> getAdapter()
The adapter that is being used by the controller to mediate external events and the state graph.

Returns:
the adapter used by this controller


Copyright © 2006-2007 Tom Gibara. All Rights Reserved.