Oracle Fusion Middleware
Oracle WebLogic Server API Reference
12c Release 1 (12.1.1)

Part Number E24391-02

weblogic.timers
Interface Timer


public interface Timer

This interface allows one to query and cancel a timer that is returned when scheduling a timer listener with a timer manager.


Method Summary
 boolean cancel()
          Cancel the timer so it does not execute.
 TimerListener getListener()
          Return the listener supplied to the timer manager when this timer was created.
 long getPeriod()
          Return the period used to compute the next time this timer will expire.
 ScheduleExpression getSchedule()
          Get the schedule expression corresponding to this timer.
 long getTimeout()
          Return the time at which this timer will expire.
 boolean isCalendarTimer()
          Whether this timer is a calendar-based timer
 boolean isCancelled()
           
 boolean isStopped()
           
 

Method Detail

getTimeout

long getTimeout()
Return the time at which this timer will expire. The value returned is an absolute time (even if the timer was created with a relative time).

Returns:
absolute time at which this timer will expire

getPeriod

long getPeriod()
Return the period used to compute the next time this timer will expire. A value of zero indicates that the timer is a one-shot. A negative value means the next timeout is computed from the current timeout. Positive values mean the timeout is computed using the current timer after the listener has executed. This value is meaningless for calendar-based timers.

Returns:
period used to reset the timer

getListener

TimerListener getListener()
Return the listener supplied to the timer manager when this timer was created.

Returns:
TimerListener the listener supplied when the timer

cancel

boolean cancel()
Cancel the timer so it does not execute. If this method returns false, that means it has already been cancelled or that it has already executed.

Returns:
true if the timer is found and successfully cancelled, otherwise false

isStopped

boolean isStopped()

isCancelled

boolean isCancelled()

isCalendarTimer

boolean isCalendarTimer()
Whether this timer is a calendar-based timer

Returns:
True if this timer is a calendar-based Timer, false otherwise.
Since:
12.1.1.0

getSchedule

ScheduleExpression getSchedule()
Get the schedule expression corresponding to this timer. The timer must be a calendar-based timer.

Returns:
schedule expression for the timer, or null if this timer is not a calendar-based timer.
Since:
12.1.1.0

Copyright 1996, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Oracle Fusion Middleware
Oracle WebLogic Server API Reference
12c Release 1 (12.1.1)

Part Number E24391-02