public class RhinoTimerOptions extends TimerOptions
An extension of the JAIN SLEE-defined class that provides access to Rhino-specific features.
Replication Factor
The replication factor specifies the number of remote timer server nodes that the timer will be arbitrarily replicated to when armed on an activity that replicates using a mechanism other than the traditional savanna framework.
The default value is 0, meaning the timer will not be replicated on these activities.
If a replication factor greater than 0 is specified, then the convergence name session ownership record option must also be set. The value of this option is ignored if the activity replicates using savanna, or is not replicated at all, although the condition specified by the previous sentence still holds true in any case. In other words, if a replication factor greater than 0 is specified then the convergence name session ownership record option must also be set, even if the replication factor will be ignored as a result of the replication mode of the activity. The reason for this is to provide consistent application behaviour regardless of how an administrator might configure the Rhino cluster the application runs on.
Convergence Name Session Ownership Record
The convergence name session ownership record of the SBB entity tree arming the timer, as returned by one of:
This record is used to identify current ownership of the SBB entity tree within the Rhino cluster when a replicated timer fires.
Constructor and Description |
---|
RhinoTimerOptions()
Create a
RhinoTimerOptions object that describes the default timer behaviour. |
RhinoTimerOptions(int replicationFactor,
ConvergenceNameSessionOwnershipRecord convergenceNameRecord)
Create a
RhinoTimerOptions object for the specified timer behaviour. |
RhinoTimerOptions(long timeout,
TimerPreserveMissed preserveMissed,
int replicationFactor,
ConvergenceNameSessionOwnershipRecord convergenceNameRecord)
Create a
RhinoTimerOptions object for the specified timer behaviour. |
RhinoTimerOptions(TimerOptions options)
Create a
RhinoTimerOptions object that has the same behavioural properties as another TimerOptions . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Compare this Rhino timer options object for equality with another.
|
ConvergenceNameSessionOwnershipRecord |
getConvergenceNameSessionOwnershipRecord()
Get the convergence name session ownership record of the SBB entity tree owning the timer.
|
int |
getReplicationFactor()
Get the timer replication factor.
|
void |
setConvergenceNameSessionOwnershipRecord(ConvergenceNameSessionOwnershipRecord convergenceNameRecord)
Set the convergence name session ownership record for the SBB entity tree owning the timer.
|
void |
setReplicationFactor(int replicationFactor)
Set the timer replication factor.
|
String |
toString()
Get the textual representation of the Rhino timer options object.
|
getPreserveMissed, getTimeout, hashCode, isPersistent, setPersistent, setPreserveMissed, setTimeout
public RhinoTimerOptions()
Create a RhinoTimerOptions
object that describes the default timer behaviour.
The default timer behaviour is:
the default behaviour as defined by the TimerOptions
superclass
a replication factor of 0
no convergence name session ownership record set.
public RhinoTimerOptions(TimerOptions options)
Create a RhinoTimerOptions
object that has the same behavioural properties as another TimerOptions
.
If the provided argument is a RhinoTimerOptions
object, then the behaviour defined by the extension properties is also copied to this, otherwise the default behaviour for these properties is used.
The default behaviour for the extension properties is:
a replication factor of 0
no convergence name session ownership record set.
options
- the TimerOptions
object to copy.public RhinoTimerOptions(int replicationFactor, ConvergenceNameSessionOwnershipRecord convergenceNameRecord) throws IllegalArgumentException
Create a RhinoTimerOptions
object for the specified timer behaviour.
The default timer behaviour is used for the SLEE-defined timer options, as specified by TimerOptions.TimerOptions()
.
replicationFactor
- the replication factor.convergenceNameRecord
- the convergence name session ownership record of the SBB entity tree owning the timer.IllegalArgumentException
- if replicationFactor
is less than zero.public RhinoTimerOptions(long timeout, TimerPreserveMissed preserveMissed, int replicationFactor, ConvergenceNameSessionOwnershipRecord convergenceNameRecord) throws NullPointerException, IllegalArgumentException
Create a RhinoTimerOptions
object for the specified timer behaviour.
The deprecated persistent
option is set to false
by this constructor.
timeout
- the timeout period for the timer (specified in milliseconds).preserveMissed
- the behaviour of late timers.replicationFactor
- the replication factor.convergenceNameRecord
- the convergence name session ownership record of the SBB entity tree owning the timer.NullPointerException
- if preserveMissed
is null
.IllegalArgumentException
- if timeout
or replicationFactor
is less than zero.public int getReplicationFactor()
Get the timer replication factor.
public void setReplicationFactor(int replicationFactor)
Set the timer replication factor.
replicationFactor
- the timer replication factor.IllegalArgumentException
- if replicationFactor
is less than zero.public ConvergenceNameSessionOwnershipRecord getConvergenceNameSessionOwnershipRecord()
Get the convergence name session ownership record of the SBB entity tree owning the timer.
null
if none has been set.public void setConvergenceNameSessionOwnershipRecord(ConvergenceNameSessionOwnershipRecord convergenceNameRecord)
Set the convergence name session ownership record for the SBB entity tree owning the timer.
convergenceNameRecord
- the convergence name session ownership record of the SBB entity tree.public boolean equals(Object o)
Compare this Rhino timer options object for equality with another.
equals
in class TimerOptions
o
- the object to compare this with.true
if o
is an instance of this class representing the same Rhino timer options as this, false
otherwise.public String toString()
Get the textual representation of the Rhino timer options object.
toString
in class TimerOptions