Interface ManagedTimer
-
- All Superinterfaces:
jakarta.ejb.Timer
- All Known Implementing Classes:
CalendarTimer,DistributableTimer,OOBTimer,TimerImpl
public interface ManagedTimer extends jakarta.ejb.TimerInterface for managedTimerimplementations.- Author:
- Paul Ferraro
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidactivate()Activates a previously suspended timer.StringgetId()The unique identifier of this timer.voidinvoke()Invokes the timeout method associated with this timer.booleanisActive()Indicates whether this timer is active, i.e.booleanisCanceled()Indicates whether this timer was canceled, i.e.booleanisExpired()Indicates whether this timer has expired, i.e.voidsuspend()Suspends a previously active timer.default voidvalidateInvocationContext()Validates the invocation context of a given specification method.
-
-
-
Method Detail
-
getId
String getId()
The unique identifier of this timer.- Returns:
- a unique identifier
-
isActive
boolean isActive()
Indicates whether this timer is active, i.e. not suspended.- Returns:
- true, if this timer is active, false otherwise.
-
isCanceled
boolean isCanceled()
Indicates whether this timer was canceled, i.e. viaTimer.cancel().- Returns:
- true, if this timer was canceled, false otherwise.
-
isExpired
boolean isExpired()
Indicates whether this timer has expired, i.e. it has no more timeouts. An interval timer will always return false.- Returns:
- true, if this timer has expired, false otherwise.
-
activate
void activate()
Activates a previously suspended timer. Once active, the timer will receive timeout events as usual, including any timeouts missed while inactive.
-
suspend
void suspend()
Suspends a previously active timer. While suspended, the timer will not receive timeout events.
-
invoke
void invoke() throws ExceptionInvokes the timeout method associated with this timer. Has no impact on this timer's schedule.- Throws:
Exception
-
validateInvocationContext
default void validateInvocationContext()
Validates the invocation context of a given specification method.
-
-