com.tomgibara.pronto.control.impl
Class SignalControllerPart<S,L,P>

java.lang.Object
  extended by com.tomgibara.pronto.control.impl.SignalControllerPart<S,L,P>
Type Parameters:
S - the type of state
L - the type of label
P - the type of parameter

public class SignalControllerPart<S,L,P>
extends java.lang.Object

A ControllerPart implementation that provides functionality for the SignalControllerSettings interface.

Author:
Tom Gibara

Constructor Summary
SignalControllerPart(ControllerImpl<S,L,P> controller, SignalControllerSettings settings)
          Creates a new SignalControllerPart.
 
Method Summary
 ControllerImpl<S,L,P> getController()
          The controller of which this is part.
 void start()
          Causes a shutdown hook to be registered for the purpose of performing termination state transitions.
 boolean stop(long timeout)
          If a shutdown hook as been registered, the hook is deregistered and the method returns immediately unless JVM shutdown is in progress in which case the method blocks (subject to the specified timeout) until termination state transitions have been completed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignalControllerPart

public SignalControllerPart(ControllerImpl<S,L,P> controller,
                            SignalControllerSettings settings)
Creates a new SignalControllerPart.

Parameters:
controller - the controller that aggregates this part
settings - the settings for this part
Method Detail

start

public void start()
Causes a shutdown hook to be registered for the purpose of performing termination state transitions.


stop

public boolean stop(long timeout)
If a shutdown hook as been registered, the hook is deregistered and the method returns immediately unless JVM shutdown is in progress in which case the method blocks (subject to the specified timeout) until termination state transitions have been completed.

Parameters:
timeout - the (approx.) number of milliseconds for which a call to the method will block, or 0L.
Returns:
true if the part was able to confirm that all operation had ceased

getController

public ControllerImpl<S,L,P> getController()
The controller of which this is part.

Returns:
the controller that aggregates this part.


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