Class OOBTimer<I>
- java.lang.Object
-
- org.jboss.as.ejb3.timerservice.distributable.OOBTimer<I>
-
- All Implemented Interfaces:
jakarta.ejb.Timer,ManagedTimer
public class OOBTimer<I> extends Object implements 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
Constructors Constructor Description OOBTimer(TimerManager<I,Batch> manager, I id, TimedObjectInvoker invoker, TimerSynchronizationFactory<I> synchronizationFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()Activates a previously suspended timer.voidcancel()booleanequals(Object object)jakarta.ejb.TimerHandlegetHandle()StringgetId()The unique identifier of this timer.SerializablegetInfo()DategetNextTimeout()jakarta.ejb.ScheduleExpressiongetSchedule()longgetTimeRemaining()inthashCode()voidinvoke()Invokes the timeout method associated with this timer.booleanisActive()Indicates whether this timer is active, i.e. not suspended.booleanisCalendarTimer()booleanisCanceled()Indicates whether this timer was canceled, i.e. viaTimer.cancel().booleanisExpired()Indicates whether this timer has expired, i.e. it has no more timeouts.booleanisPersistent()voidsuspend()Suspends a previously active timer.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jboss.as.ejb3.timerservice.spi.ManagedTimer
validateInvocationContext
-
-
-
-
Constructor Detail
-
OOBTimer
public OOBTimer(TimerManager<I,Batch> manager, I id, TimedObjectInvoker invoker, TimerSynchronizationFactory<I> synchronizationFactory)
-
-
Method Detail
-
cancel
public void cancel()
- Specified by:
cancelin interfacejakarta.ejb.Timer
-
getTimeRemaining
public long getTimeRemaining()
- Specified by:
getTimeRemainingin interfacejakarta.ejb.Timer
-
getNextTimeout
public Date 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
public Serializable getInfo()
- Specified by:
getInfoin interfacejakarta.ejb.Timer
-
getHandle
public jakarta.ejb.TimerHandle getHandle()
- Specified by:
getHandlein interfacejakarta.ejb.Timer
-
getId
public String 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
public void invoke() throws ExceptionDescription 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.
-
-