org.primordion.xholon.base
Interface IXholonTime

All Known Implementing Classes:
XholonTime

public interface IXholonTime

Handle time in a Xholon application.

Since:
0.3 (Created on April 15, 2006)
Author:
Ken Webb

Field Summary
static int NUM_MILLISECONDS_PER_SECOND
           
static int TIMERTYPE_ABSOLUTE
           
static int TIMERTYPE_RELATIVE
           
static int TIMERTYPE_REPEAT
           
 
Method Summary
 void cancel(XholonTimerTask xhTimerTask)
          Cancel a relative, repeat or absolute timeout.
 void cancelAll()
          Cancel all timeouts.
 XholonTimerTask timeoutAbsolute(IXholon clientNode, java.util.Date time)
          Timeout at a specified absolute time in the future.
 XholonTimerTask timeoutRelative(IXholon clientNode, long delay)
          Timeout after a specified number of milliseconds, relative to the current time.
 XholonTimerTask timeoutRelative(IXholon clientNode, java.lang.Object data, long delay)
          Timeout after a specified number of milliseconds, relative to the current time.
 XholonTimerTask timeoutRepeat(IXholon clientNode, long delay, long period)
          Timeout repeatedly every so many milliseconds.
 XholonTimerTask timeoutRepeat(IXholon clientNode, java.lang.Object data, long delay, long period)
          Timeout repeatedly every so many milliseconds.
 

Field Detail

NUM_MILLISECONDS_PER_SECOND

public static final int NUM_MILLISECONDS_PER_SECOND
See Also:
Constant Field Values

TIMERTYPE_RELATIVE

public static final int TIMERTYPE_RELATIVE
See Also:
Constant Field Values

TIMERTYPE_REPEAT

public static final int TIMERTYPE_REPEAT
See Also:
Constant Field Values

TIMERTYPE_ABSOLUTE

public static final int TIMERTYPE_ABSOLUTE
See Also:
Constant Field Values
Method Detail

timeoutRelative

public XholonTimerTask timeoutRelative(IXholon clientNode,
                                       long delay)
Timeout after a specified number of milliseconds, relative to the current time.

Parameters:
clientNode - The xholon client node that will receive a message when the timeout occurs.
delay - The number of milliseconds to wait before timing out.

timeoutRelative

public XholonTimerTask timeoutRelative(IXholon clientNode,
                                       java.lang.Object data,
                                       long delay)
Timeout after a specified number of milliseconds, relative to the current time.

Parameters:
clientNode - The xholon client node that will receive a message when the timeout occurs.
data - User data to return as part of the message when the timeout occurs.
delay - The number of milliseconds to wait before timing out.

timeoutRepeat

public XholonTimerTask timeoutRepeat(IXholon clientNode,
                                     long delay,
                                     long period)
Timeout repeatedly every so many milliseconds.

Parameters:
clientNode - The xholon client node that will receive a message each time the timeout occurs.
delay - The number of milliseconds to delay before the first timeout occurs.
period - The number of milliseconds in each timeout period, after the first timeout.

timeoutRepeat

public XholonTimerTask timeoutRepeat(IXholon clientNode,
                                     java.lang.Object data,
                                     long delay,
                                     long period)
Timeout repeatedly every so many milliseconds.

Parameters:
clientNode - The xholon client node that will receive a message each time the timeout occurs.
data - User data to return as part of the message when the timeout occurs.
delay - The number of milliseconds to delay before the first timeout occurs.
period - The number of milliseconds in each timeout period, after the first timeout.

timeoutAbsolute

public XholonTimerTask timeoutAbsolute(IXholon clientNode,
                                       java.util.Date time)
Timeout at a specified absolute time in the future.

Parameters:
time - The absolute time and date at which the timeout will occur.
clientNode - The xholon client node that will receive a message when the timeout occurs.

cancel

public void cancel(XholonTimerTask xhTimerTask)
Cancel a relative, repeat or absolute timeout.


cancelAll

public void cancelAll()
Cancel all timeouts. This should probably only be called when an application has finished running, and especially before another application is subsequently opened.