Class 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 to net.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:
    1. TimerRequest.builder()
                  .timerName("name")
                  .time(Instant)
                  .build()
      a one-shot timer scheduled to expire on a given date and time.
    2. TimerRequest.builder()
                  .timerName("name")
                  .delay(long)
                  .build()
      a one-shot timer scheduled to expire after the specified millisecond delay.
    3. TimerRequest.builder()
                  .timerName("name")
                  .time(Instant)
                  .period(long)
                  .fixedRate(boolean)
                  .build()
      a repeating timer which first expires on a given date and time and after that on a periodic millisecond rate. If the fixedRate parameter is true, then the timer is scheduled using Timer.scheduleAtFixedRate(java.util.TimerTask, Date, long). Otherwise, the timer is scheduled using Timer.schedule(java.util.TimerTask, Date, long).
    4. TimerRequest.builder()
                  .timerName("name")
                  .delay(long)
                  .period(long)
                  .fixedRate(boolean)
                  .build()
      a repeating timer which first expires after a specified millisecond delay and then on a periodic millisecond rate. if fixedRate parameter is true, then the timer is scheduled using Timer.scheduleAtFixedRate(java.util.TimerTask, Date, long). Otherwise, the timer is scheduled using Timer.schedule(java.util.TimerTask, Date, long).
    Author:
    Charles Rapp
    See Also:
    Serialized Form
    • 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 to null and specify a delay.
      • 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 a time.
      • 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.
        If true, 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.
        Overrides:
        toString in class EMessage
        Returns:
        the request message as text.
      • builder

        public static TimerRequest.Builder builder()
        Deprecated.
        Returns a timer request builder instance.
        Returns:
        message builder instance.