Class OOBTimer<I>
java.lang.Object
org.jboss.as.ejb3.timerservice.distributable.OOBTimer<I>
- Type Parameters:
I- the timer identifier type
- All Implemented Interfaces:
jakarta.ejb.Timer,ManagedTimer
Timer implementation for use outside the context of a timeout event.
Ensures that all timer methods are invoked within the context of a batch.
- Author:
- Paul Ferraro
-
Constructor Summary
ConstructorsConstructorDescriptionOOBTimer(TimerManager<I, Batch> manager, I id, TimedObjectInvoker invoker, TimerSynchronizationFactory<I> synchronizationFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Activates a previously suspended timer.voidcancel()booleanjakarta.ejb.TimerHandlegetId()The unique identifier of this timer.getInfo()jakarta.ejb.ScheduleExpressionlonginthashCode()voidinvoke()Invokes the timeout method associated with this timer.booleanisActive()Indicates whether this timer is active, i.e. not suspended.booleanbooleanIndicates whether this timer was canceled, i.e. viaTimer.cancel().booleanIndicates whether this timer has expired, i.e. it has no more timeouts.booleanvoidsuspend()Suspends a previously active timer.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jboss.as.ejb3.timerservice.spi.ManagedTimer
validateInvocationContext
-
Constructor Details
-
OOBTimer
public OOBTimer(TimerManager<I, Batch> manager, I id, TimedObjectInvoker invoker, TimerSynchronizationFactory<I> synchronizationFactory)
-
-
Method Details
-
cancel
public void cancel()- Specified by:
cancelin interfacejakarta.ejb.Timer
-
getTimeRemaining
public long getTimeRemaining()- Specified by:
getTimeRemainingin interfacejakarta.ejb.Timer
-
getNextTimeout
- Specified by:
getNextTimeoutin interfacejakarta.ejb.Timer
-
getSchedule
public jakarta.ejb.ScheduleExpression getSchedule()- Specified by:
getSchedulein interfacejakarta.ejb.Timer
-
isPersistent
public boolean isPersistent()- Specified by:
isPersistentin interfacejakarta.ejb.Timer
-
isCalendarTimer
public boolean isCalendarTimer()- Specified by:
isCalendarTimerin interfacejakarta.ejb.Timer
-
getInfo
- Specified by:
getInfoin interfacejakarta.ejb.Timer
-
getHandle
public jakarta.ejb.TimerHandle getHandle()- Specified by:
getHandlein interfacejakarta.ejb.Timer
-
getId
Description copied from interface:ManagedTimerThe unique identifier of this timer.- Specified by:
getIdin interfaceManagedTimer- Returns:
- a unique identifier
-
activate
public void activate()Description copied from interface:ManagedTimerActivates a previously suspended timer. Once active, the timer will receive timeout events as usual, including any timeouts missed while inactive.- Specified by:
activatein interfaceManagedTimer
-
suspend
public void suspend()Description copied from interface:ManagedTimerSuspends a previously active timer. While suspended, the timer will not receive timeout events.- Specified by:
suspendin interfaceManagedTimer
-
invoke
Description copied from interface:ManagedTimerInvokes the timeout method associated with this timer. Has no impact on this timer's schedule.- Specified by:
invokein interfaceManagedTimer- Throws:
Exception
-
isActive
public boolean isActive()Description copied from interface:ManagedTimerIndicates whether this timer is active, i.e. not suspended.- Specified by:
isActivein interfaceManagedTimer- Returns:
- true, if this timer is active, false otherwise.
-
isCanceled
public boolean isCanceled()Description copied from interface:ManagedTimerIndicates whether this timer was canceled, i.e. viaTimer.cancel().- Specified by:
isCanceledin interfaceManagedTimer- Returns:
- true, if this timer was canceled, false otherwise.
-
isExpired
public boolean isExpired()Description copied from interface:ManagedTimerIndicates whether this timer has expired, i.e. it has no more timeouts. An interval timer will always return false.- Specified by:
isExpiredin interfaceManagedTimer- Returns:
- true, if this timer has expired, false otherwise.
-
hashCode
public int hashCode() -
equals
-
toString
-