com.bea.control
Interface TimerControl


public interface TimerControl

The control interface for the timer control.


Nested Class Summary
static interface TimerControl.Callback
          Provides a way for the Timer control to receive callbacks.
static interface TimerControl.TimerSettings
           
 
Method Summary
 boolean getCoalesceEvents()
          This is an 8.1 back-compat API; returns the CoalesceEvents setting.
 Serializable getPayload()
          Gets the payload
 String getRepeatsEvery()
          This is an 8.1 back-compat API; returns the repeat interval setting as duration.
 long getTimeout()
          This is an 8.1 back-compat API; gets the relative number of seconds from now when the timer will timeout (rounded up).
 Date getTimeoutAt()
          Get the absolute date and time.
 boolean isRunning()
          Get the running state of the timer.
 void restart()
          Resets the timer.
 void setCoalesceEvents(boolean coalesceEvents)
          This is an 8.1 back-compat API; set the CoalesceEvents setting.
 void setPayload(Serializable payload)
          Sets a payload so when the timer fires the data can be used by event handler(s)
 void setRepeatsEvery(long seconds)
          Sets the repeating interval, in number of seconds
 void setRepeatsEvery(String duration)
          Sets the repeating interval, in duration
 void setTimeout(long seconds)
          Sets the timeout setting, using a long in number of seconds
 void setTimeout(String delay)
          Sets the timeout setting, using a duration setting
 void setTimeoutAt(Date time)
          Sets the absolute date and time at which the timer will expire the first time after being started or restarted.
 void start()
          Starts the timer.
 void stop()
          Stops the timer.
 

Method Detail

restart

@TransactionAttribute(value=SUPPORTS)
void restart()
Resets the timer. Any pending events are canceled. The timer will subsequently expire after the repeats-every period has elapsed after this call.


start

@TransactionAttribute(value=SUPPORTS)
void start()
Starts the timer. The first timer expiration will occur after the period specified by the timeout attribute has elapsed.


stop

@TransactionAttribute(value=SUPPORTS)
void stop()
Stops the timer. No further timer expiration callbacks will be invoked.


setTimeoutAt

void setTimeoutAt(Date time)
Sets the absolute date and time at which the timer will expire the first time after being started or restarted.

Parameters:
time - The date and time at which the timer should first expire after being started or restarted.

getTimeoutAt

Date getTimeoutAt()
Get the absolute date and time.

Returns:
a date.

setPayload

void setPayload(Serializable payload)
Sets a payload so when the timer fires the data can be used by event handler(s)


getPayload

Serializable getPayload()
Gets the payload


isRunning

boolean isRunning()
Get the running state of the timer.

Returns:
true if running.

getTimeout

long getTimeout()
This is an 8.1 back-compat API; gets the relative number of seconds from now when the timer will timeout (rounded up).

Returns:
the number of seconds when it will time out from now

setTimeout

void setTimeout(long seconds)
Sets the timeout setting, using a long in number of seconds

Parameters:
seconds - number of seconds

setTimeout

void setTimeout(String delay)
Sets the timeout setting, using a duration setting

Parameters:
delay - a duration

setRepeatsEvery

void setRepeatsEvery(long seconds)
Sets the repeating interval, in number of seconds

Parameters:
seconds - number of seconds

setRepeatsEvery

void setRepeatsEvery(String duration)
Sets the repeating interval, in duration

Parameters:
duration - setting in duration

getRepeatsEvery

String getRepeatsEvery()
This is an 8.1 back-compat API; returns the repeat interval setting as duration.

Returns:
a String that represents repeat interval in duration

setCoalesceEvents

void setCoalesceEvents(boolean coalesceEvents)
This is an 8.1 back-compat API; set the CoalesceEvents setting.

Parameters:
coalesceEvents - true or false

getCoalesceEvents

boolean getCoalesceEvents()
This is an 8.1 back-compat API; returns the CoalesceEvents setting.

Returns:
a boolean value