public class TimerOptions extends Object implements Serializable
TimerOptions
class specifies the behavior of a timer when it is set.
Timeout - Under normal conditions and expected workload, a SLEE and its Timer Facility should be able to fire timer events on time. However, under overload conditions, or when the SLEE is not running, the Timer Facility may not be able to do so. The timeout value allows some flexibility in deciding when a scheduled timer becomes late. A timer is considered late if the Timer Facility cannot fire a scheduled timer event by its scheduled expiry time + timer timeout. For a periodic timer, the timeout must be less than the timer's period.
Preserving Missed Timer Events - The default timer options cause the Timer Facility to only generate the last event in a sequence of late timer events for a timer that fires late. This guarantees at least one timer event (the last, for a periodic timer) will be generated for a timer. However an SBB can still choose to receive all or none of the late timer events if desired.
Persistent Timers - Deprecated in SLEE 1.1 - This option has been deprecated. The semantics of persistent timers were unclear as the definition of persistent implied by this option was inconsistent with the general use of the term "persistent" in the rest of the specification.
Constructor and Description |
---|
TimerOptions()
Create a
TimerOptions object that describes the default timer behavior. |
TimerOptions(boolean persistent,
long timeout,
TimerPreserveMissed preserveMissed)
Deprecated.
This constructor specifies the value of the persistent option, which
has been deprecated. It has been replaced with
TimerOptions(long, TimerPreserveMissed) . |
TimerOptions(long timeout,
TimerPreserveMissed preserveMissed)
Create a
TimerOptions object for the specified timer behavior. |
TimerOptions(TimerOptions options)
Create a
TimerOptions object that has the same behavioral properties as
another TimerOptions . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Compare this timer options object for equality with another.
|
TimerPreserveMissed |
getPreserveMissed()
Get the value of the preserve-missed option.
|
long |
getTimeout()
Get the timeout period.
|
int |
hashCode()
Get a hash code value for this timer options object.
|
boolean |
isPersistent()
Deprecated.
the persistent option has been deprecated.
|
void |
setPersistent(boolean persistent)
Deprecated.
the persistent option has been deprecated.
|
void |
setPreserveMissed(TimerPreserveMissed preserveMissed)
Set the value of the preserve missed option.
|
void |
setTimeout(long timeout)
Set the timeout period.
|
String |
toString()
Get the textual representation of the timer options object.
|
public TimerOptions()
TimerOptions
object that describes the default timer behavior.
The default timer behavior is:
false
by this constructor.public TimerOptions(TimerOptions options)
TimerOptions
object that has the same behavioral properties as
another TimerOptions
.options
- the TimerOptions
object to copy.public TimerOptions(boolean persistent, long timeout, TimerPreserveMissed preserveMissed) throws NullPointerException, IllegalArgumentException
TimerOptions(long, TimerPreserveMissed)
.TimerOptions
object for the specified timer behavior.persistent
- boolean value indicating whether the timer should be persistent or not.timeout
- the timeout period for the timer (specified in milliseconds).preserveMissed
- the behavior of late timers.NullPointerException
- if preserveMissed
is null
.IllegalArgumentException
- if timeout
is less than zero.public TimerOptions(long timeout, TimerPreserveMissed preserveMissed) throws NullPointerException, IllegalArgumentException
TimerOptions
object for the specified timer behavior.
The deprecated persistent option is set to false
by this constructor.timeout
- the timeout period for the timer (specified in milliseconds).preserveMissed
- the behavior of late timers.NullPointerException
- if preserveMissed
is null
.IllegalArgumentException
- if timeout
is less than zero.public final boolean isPersistent()
true
if the timer should be persistent, false
otherwise.public final void setPersistent(boolean persistent)
persistent
- boolean value indicating whether the timer should be persistent or not.public final long getTimeout()
public final void setTimeout(long timeout) throws IllegalArgumentException
timeout
- the timeout period (specified in milliseconds).IllegalArgumentException
- if timeout
less than zero.public final TimerPreserveMissed getPreserveMissed()
public final void setPreserveMissed(TimerPreserveMissed preserveMissed) throws NullPointerException
preserveMissed
- the behavior of late timers.NullPointerException
- if preserveMissed
is null
.public boolean equals(Object obj)
public int hashCode()