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

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

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

A ControllerPart implementation that provides functionality for the StdinControllerSettings interface.

Author:
Tom Gibara

Constructor Summary
StdinControllerPart(ControllerImpl<S,L,P> controller, StdinControllerSettings settings)
          Creates a new StdinControllerPart.
 
Method Summary
 ControllerImpl<S,L,P> getController()
          The controller of which this is part.
 void start()
          Uses the shared pronto executor to schedule periodic checks on STDIN.
 boolean stop(long timeout)
          Requests that the Pronto executor stops any future STDIN checks and then waits (subject to the supplied timeout) until the ceasation of any ongoing checking has been confirmed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StdinControllerPart

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

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

start

public void start()
Uses the shared pronto executor to schedule periodic checks on STDIN.


stop

public boolean stop(long timeout)
Requests that the Pronto executor stops any future STDIN checks and then waits (subject to the supplied timeout) until the ceasation of any ongoing checking has been confirmed.

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.