Interface ManagedTimerService
-
- All Superinterfaces:
Restartable,javax.ejb.TimerService
- All Known Implementing Classes:
CompositeTimerService,DistributableTimerService,NonFunctionalTimerService,TimerServiceImpl
public interface ManagedTimerService extends javax.ejb.TimerService, Restartable
Interface for managedTimerServiceimplementations.- Author:
- Paul Ferraro
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default javax.ejb.TimercreateCalendarTimer(javax.ejb.ScheduleExpression schedule)default javax.ejb.TimercreateIntervalTimer(long initialDuration, long intervalDuration, javax.ejb.TimerConfig config)default javax.ejb.TimercreateSingleActionTimer(long duration, javax.ejb.TimerConfig config)default javax.ejb.TimercreateTimer(long initialDuration, long intervalDuration, Serializable info)default javax.ejb.TimercreateTimer(long duration, Serializable info)default javax.ejb.TimercreateTimer(Date initialExpiration, long intervalDuration, Serializable info)default javax.ejb.TimercreateTimer(Date expiration, Serializable info)ManagedTimerfindTimer(String id)Returns the managed timer associated with the specified identifierstatic javax.transaction.TransactiongetActiveTransaction()TimedObjectInvokergetInvoker()Returns the invoker for the timed object associated with this timer service.static booleanisLifecycleCallbackInvocation()Returns true if theCurrentInvocationContextrepresents a lifecycle callback invocation.default voidvalidateInvocationContext()Validates the invocation context of a given specification method.-
Methods inherited from interface org.wildfly.clustering.ee.Restartable
start, stop
-
-
-
-
Method Detail
-
findTimer
ManagedTimer findTimer(String id)
Returns the managed timer associated with the specified identifier- Parameters:
id- a timer identifier- Returns:
- a managed timer
-
getInvoker
TimedObjectInvoker getInvoker()
Returns the invoker for the timed object associated with this timer service.- Returns:
- a timed object invoker
-
createCalendarTimer
default javax.ejb.Timer createCalendarTimer(javax.ejb.ScheduleExpression schedule)
- Specified by:
createCalendarTimerin interfacejavax.ejb.TimerService
-
createIntervalTimer
default javax.ejb.Timer createIntervalTimer(long initialDuration, long intervalDuration, javax.ejb.TimerConfig config)- Specified by:
createIntervalTimerin interfacejavax.ejb.TimerService
-
createSingleActionTimer
default javax.ejb.Timer createSingleActionTimer(long duration, javax.ejb.TimerConfig config)- Specified by:
createSingleActionTimerin interfacejavax.ejb.TimerService
-
createTimer
default javax.ejb.Timer createTimer(long duration, Serializable info) throws javax.ejb.EJBException- Specified by:
createTimerin interfacejavax.ejb.TimerService- Throws:
javax.ejb.EJBException
-
createTimer
default javax.ejb.Timer createTimer(long initialDuration, long intervalDuration, Serializable info)- Specified by:
createTimerin interfacejavax.ejb.TimerService
-
createTimer
default javax.ejb.Timer createTimer(Date expiration, Serializable info)
- Specified by:
createTimerin interfacejavax.ejb.TimerService
-
createTimer
default javax.ejb.Timer createTimer(Date initialExpiration, long intervalDuration, Serializable info)
- Specified by:
createTimerin interfacejavax.ejb.TimerService
-
validateInvocationContext
default void validateInvocationContext()
Validates the invocation context of a given specification method.
-
getActiveTransaction
static javax.transaction.Transaction getActiveTransaction()
- Returns:
- true if the transaction is in a state where synchronizations can be registered
-
isLifecycleCallbackInvocation
static boolean isLifecycleCallbackInvocation()
Returns true if theCurrentInvocationContextrepresents a lifecycle callback invocation. Else returns false.This method internally relies on
CurrentInvocationContext.get()to obtain the current invocation context.- If the context is available then it looks for the method that was invoked. The absence of a method indicates a lifecycle callback.
- If the context is not available, then this method returns false (i.e.
it doesn't consider the current invocation as a lifecycle callback). This is
for convenience, to allow the invocation of
TimerServicemethods in the absence ofCurrentInvocationContext
- Returns:
-
-