All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.ibm.beans.gauge.Timer

java.lang.Object
   |
   +----COM.ibm.beans.gauge.Timer

public class Timer
extends Object
implements Serializable

Constructor Index

 o Timer()
 

Method Index

 o closeTimerSession(Object)
Remove the key from the timer's open sessions list.
 o copyright()
 
 o elapsedTime(Object)
Return the elapsed time counter for the timer session.
 o hasTimerSession(Object)
Report whether a timer session has been opened for the given key.
 o openTimerSession(Object)
Register a timer session identified by the given key.
 o resetTimer(Object)
Reset the elapsed time counter for the timer session
 o waitUntil(Object, long)
Wait until a given elapsed time from the last reset of the timer session.
 o waitUntil(Object, long, Object)
Wait until a given elapsed time from the last reset of the timer session, or until the monitor is notified, whichever occurs sooner.

Constructors

 o Timer

 public Timer()

Methods

 o copyright

 public static String copyright()

 o openTimerSession

 public static void openTimerSession(Object key)
Register a timer session identified by the given key. The timer class maintains separate timer sessions for different keys
Parameters:
key - an object to use as the key for a timer session
See Also:
closeTimerSession

 o closeTimerSession

 public static void closeTimerSession(Object key)
Remove the key from the timer's open sessions list.
Parameters:
key - an object to use as the key for a timer session
See Also:
openTimerSession

 o hasTimerSession

 public static boolean hasTimerSession(Object key)
Report whether a timer session has been opened for the given key.
Parameters:
key - an object to be searched for in the open session list
Returns:
whether a timer session has been opened for that key

 o resetTimer

 public static void resetTimer(Object key)
Reset the elapsed time counter for the timer session
Parameters:
key - an object for which a timer session has been opened

 o elapsedTime

 public static long elapsedTime(Object key)
Return the elapsed time counter for the timer session.
Parameters:
key - an object for which a timer session has been opened
Returns:
elapsed time since last reset in milliseconds

 o waitUntil

 public static boolean waitUntil(Object key,
                                 long ms,
                                 Object monitor) throws InterruptedException
Wait until a given elapsed time from the last reset of the timer session, or until the monitor is notified, whichever occurs sooner. Once this method starts waiting, it will not take account of any resets of the timer that take place from other threads. When the waiting ends, the timer is reset.
Parameters:
key - an object for which a timer session has been opened
ms - elapsed time to wait in milliseconds
notifier - an object upon which to wait
Returns:
whether the specified interval fully expired (false indicates the wait was terminated by a notify)
Throws: InterruptedException
if interrupted

 o waitUntil

 public static boolean waitUntil(Object key,
                                 long ms) throws InterruptedException
Wait until a given elapsed time from the last reset of the timer session. Once this method starts waiting, it will not take account of any resets of the timer that take place from other threads. When the waiting ends, the timer is reset.
Parameters:
key - an object for which a timer session has been opened
ms - elapsed time to wait in milliseconds
Throws: InterruptedException
if interrupted

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Copyright © Taligent, Inc. 1996 - 1997.
Copyright
© IBM Corporation 1996 - 1997.
All Rights Reserved.