org.jppf.node.idle
Class IdleDetectionTask

java.lang.Object
  extended by java.util.TimerTask
      extended by org.jppf.node.idle.IdleDetectionTask
All Implemented Interfaces:
Runnable

public class IdleDetectionTask
extends TimerTask

Timer tasks that displays a message whenever the computer has received no mouse or keyboard input for at least the timeout time.


Constructor Summary
IdleDetectionTask(IdleTimeDetectorFactory factory, long idleTimeout, IdleStateListener... initialListeners)
          Initialize this task with the specified idle timeout and listeners.
 
Method Summary
 void addIdleStateListener(IdleStateListener listener)
          Add a listener to the list of listeners.
 IdleState getState()
          Get the idle state of the system, as specified by the idle timeout.
 void removeIdleStateListener(IdleStateListener listener)
          Remove a listener from the list of listeners.
 void run()
          
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdleDetectionTask

public IdleDetectionTask(IdleTimeDetectorFactory factory,
                         long idleTimeout,
                         IdleStateListener... initialListeners)
Initialize this task with the specified idle timeout and listeners.

Parameters:
factory - a factory for creating IdleTimeDetector instances.
idleTimeout - the time of inactivity after which the system is considered idle, in milliseconds.
initialListeners - a set of listeners to add to this task at construction time.
Method Detail

run

public void run()

Specified by:
run in interface Runnable
Specified by:
run in class TimerTask

getState

public IdleState getState()
Get the idle state of the system, as specified by the idle timeout.

Returns:
an IdleState enum value.

addIdleStateListener

public void addIdleStateListener(IdleStateListener listener)
Add a listener to the list of listeners.

Parameters:
listener - the listener to add.

removeIdleStateListener

public void removeIdleStateListener(IdleStateListener listener)
Remove a listener from the list of listeners.

Parameters:
listener - the listener to remove.


Copyright © 2005-2010 JPPF Team.