Package net.sf.eBusx.util
Class TimerRequest
- java.lang.Object
-
- net.sf.eBus.messages.EMessageObject
-
- net.sf.eBus.messages.EMessage
-
- net.sf.eBus.messages.ERequestMessage
-
- net.sf.eBusx.util.TimerRequest
-
- All Implemented Interfaces:
java.io.Serializable
@Deprecated @EReplyInfo(replyMessageClasses=TimerReply.class) @ELocalOnly public final class TimerRequest extends ERequestMessage implements java.io.Serializable
Deprecated.Please move tonet.sf.eBus.client.EScheduledTimer
for scheduled task timing.Send this request to schedule a timer task. Each timer request must have a unique name, that is, no two timer requests currently running must have the same name. Timer requests come in four kinds:-
a one-shot timer scheduled to expire on a given date and time.TimerRequest.builder() .timerName("name") .time(Instant) .build()
-
a one-shot timer scheduled to expire after the specified millisecond delay.TimerRequest.builder() .timerName("name") .delay(long) .build()
-
a repeating timer which first expires on a given date and time and after that on a periodic millisecond rate. If theTimerRequest.builder() .timerName("name") .time(Instant) .period(long) .fixedRate(boolean) .build()
fixedRate
parameter istrue
, then the timer is scheduled usingTimer.scheduleAtFixedRate(java.util.TimerTask, Date, long)
. Otherwise, the timer is scheduled usingTimer.schedule(java.util.TimerTask, Date, long)
. -
a repeating timer which first expires after a specified millisecond delay and then on a periodic millisecond rate. ifTimerRequest.builder() .timerName("name") .delay(long) .period(long) .fixedRate(boolean) .build()
fixedRate
parameter istrue
, then the timer is scheduled usingTimer.scheduleAtFixedRate(java.util.TimerTask, Date, long)
. Otherwise, the timer is scheduled usingTimer.schedule(java.util.TimerTask, Date, long)
.
- Author:
- Charles Rapp
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TimerRequest.Builder
Deprecated.TimerRequest
builder.-
Nested classes/interfaces inherited from class net.sf.eBus.messages.EMessage
EMessage.MessageType
-
-
Field Summary
Fields Modifier and Type Field Description long
delay
Deprecated.If this timer is to expire after a millisecond delay, then set this value.boolean
fixedRate
Deprecated.Iftrue
, then repeating timers are run using fixed rate scheduling.long
period
Deprecated.If this timer is repeating, then set this millisecond period.java.time.Instant
time
Deprecated.If this timer is to expire at a given time, then set this value.java.lang.String
timerName
Deprecated.The requestor-assigned name for this timer request.-
Fields inherited from class net.sf.eBus.messages.EMessage
MAX_SUBJECT_LENGTH, subject, timestamp
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static TimerRequest.Builder
builder()
Deprecated.Returns a timer request builder instance.java.lang.String
toString()
Deprecated.Returns a textual representation of this timer request message.-
Methods inherited from class net.sf.eBus.messages.EMessage
equals, hashCode, isApplicationMessage, isSystemMessage, key, messageType, timestampAsInstant
-
-
-
-
Field Detail
-
timerName
public final java.lang.String timerName
Deprecated.The requestor-assigned name for this timer request.
-
time
public final java.time.Instant time
Deprecated.If this timer is to expire at a given time, then set this value. Otherwise, set tonull
and specify adelay
.
-
delay
public final long delay
Deprecated.If this timer is to expire after a millisecond delay, then set this value. Otherwise, set to zero and specify atime
.
-
period
public final long period
Deprecated.If this timer is repeating, then set this millisecond period. Otherwise, set to zero for a one shot timer.
-
fixedRate
public final boolean fixedRate
Deprecated.Iftrue
, then repeating timers are run using fixed rate scheduling.- See Also:
Timer.scheduleAtFixedRate(java.util.TimerTask, Date, long)
,Timer.scheduleAtFixedRate(java.util.TimerTask, long, long)
-
-
Method Detail
-
toString
public java.lang.String toString()
Deprecated.Returns a textual representation of this timer request message.
-
builder
public static TimerRequest.Builder builder()
Deprecated.Returns a timer request builder instance.- Returns:
- message builder instance.
-
-