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

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

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

A ControllerPart implementation that provides functionality for the FileControllerSettings interface.

Author:
Tom Gibara

Constructor Summary
FileControllerPart(ControllerImpl<S,L,P> controller, FileControllerSettings settings)
          Creates a new FileControllerPart.
 
Method Summary
 ControllerImpl<S,L,P> getController()
          The controller of which this is part.
 void start()
          Uses the shared pronto executor to schedule periodic file checks.
 boolean stop(long timeout)
          Requests that the Pronto executor stops any future file 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

FileControllerPart

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

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 file checks.


stop

public boolean stop(long timeout)
Requests that the Pronto executor stops any future file 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.