org.ourgrid.gridmachine.useragent
Class IdlenessCheckerDaemon

java.lang.Object
  extended by java.lang.Thread
      extended by org.ourgrid.gridmachine.useragent.IdlenessCheckerDaemon
All Implemented Interfaces:
java.lang.Runnable

public class IdlenessCheckerDaemon
extends java.lang.Thread

This idleness detector is not multiplataform (I'm sorry) as JAVA is. It was made to detect if the user is using hers workstation at Linux. At the development it will be increasely done by adding more paramether to be more and more sure about its assertion. Created on 10/20/2004

Version:
0.1 - At this first version it will only check if the keyboard and mouse are used. To implement this, we check the "file" /proc/interrupts.

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
IdlenessCheckerDaemon(UserAgentServerImpl ua, int timeForCicle)
          Initializes the daemon that will check (until be killed) the machine idleness.
 
Method Summary
 void run()
          Thread that do what this class have to do :)
protected  void shutdown()
          Sends a signal for the deamon to shutdown
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IdlenessCheckerDaemon

public IdlenessCheckerDaemon(UserAgentServerImpl ua,
                             int timeForCicle)
Initializes the daemon that will check (until be killed) the machine idleness. If the machine, at any time, stay idle for more than the specified time then the detector will start the managed OurGrid UserAgent that will wait for tasks. When the UA is started, the daemon will begin to wait for the user return to pause the agent.

Parameters:
ua - the UserAgent managed by this daemon
timeForCicle - the time in minutes that the computer have to be idle before the UA starts.
Method Detail

run

public void run()
Thread that do what this class have to do :)

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread
See Also:
Runnable.run()

shutdown

protected void shutdown()
Sends a signal for the deamon to shutdown