org.mbari.siam.core
Class CpuLeaseSleepRollcallListener

java.lang.Object
  extended by org.mbari.siam.core.CpuLeaseSleepRollcallListener
All Implemented Interfaces:
SleepRollCallListener

public class CpuLeaseSleepRollcallListener
extends java.lang.Object
implements SleepRollCallListener

CpuLeaseSleepRollcallListener is responsible for keeping the CPU awake as requested by external processes.

Author:
Bob Herlien

Field Summary
 
Fields inherited from interface org.mbari.siam.distributed.SleepRollCallListener
NO_TIME_SPECIFIED
 
Method Summary
 void cpuLease(int requestorID, long when, long howLong)
          Request that the CPU come on at a certain time in the future and/or remain on for a certain duration.
 java.util.Vector getLessees()
           
 long okToSleep()
          Return <= 0 if need to stay awake.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

cpuLease

public void cpuLease(int requestorID,
                     long when,
                     long howLong)
              throws java.rmi.RemoteException
Request that the CPU come on at a certain time in the future and/or remain on for a certain duration.

Parameters:
requestorID - Unique ID (externally assigned) to identify who is requesting the CPU to remain on. Allows for multiple requestors each requesting that the CPU be on.
when - Milliseconds until the requestor needs the CPU on. Use 0 (zero) to request that the CPU remain on starting now.
howLong - Number of milliseconds that the CPU should remain on. Use 0 (zero) to cancel an earlier request.
Throws:
java.rmi.RemoteException

okToSleep

public long okToSleep()
Return <= 0 if need to stay awake. Else, return number of milliseconds until we need to wake up.

Specified by:
okToSleep in interface SleepRollCallListener

getLessees

public java.util.Vector getLessees()


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.