Package org.jboss.as.ejb3.timerservice
Class CalendarTimer
java.lang.Object
org.jboss.as.ejb3.timerservice.TimerImpl
org.jboss.as.ejb3.timerservice.CalendarTimer
- All Implemented Interfaces:
jakarta.ejb.Timer,ManagedTimer
Represents a
Timer which is created out a calendar expression- Version:
- $Revision: $
- Author:
- Jaikiran Pai
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.jboss.as.ejb3.timerservice.TimerImpl
id, info, initialExpiration, intervalDuration, nextExpiration, persistent, previousRun, timedObjectInvoker, timerService, timerState -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CalendarTimer.Builderbuilder()Returns theCalendarBasedTimeoutcorresponding to thisCalendarTimerjakarta.ejb.ScheduleExpressionjakarta.ejb.ScheduleExpressionThis method is similar togetSchedule(), except that this method does not check the timer state and hence does not throw eitherIllegalStateExceptionorNoSuchObjectLocalExceptionorEJBException.static MethodgetTimeoutMethod(TimeoutMethod timeoutMethodInfo, ClassLoader classLoader) Returns theMethod, represented by theTimeoutMethodprotected CalendarTimerTaskReturns the task which handles the timeouts on thisCalendarTimervoidMakes sure that the timer is only run once after being restored.booleanReturns true if this is an auto-timer.booleantoString()A nice formatted string output for this timerMethods inherited from class org.jboss.as.ejb3.timerservice.TimerImpl
activate, cancel, equals, getCachedTimerInfo, getExecutingThread, getHandle, getId, getInfo, getInitialExpiration, getInterval, getNextExpiration, getNextTimeout, getPreviousRun, getState, getTimedObjectId, getTimeRemaining, getTimerInfo, getTimerService, hashCode, invoke, isActive, isCanceled, isExpired, isInRetry, isPersistent, lock, scheduleTimeout, setCachedTimerInfo, setNextTimeout, setPreviousRun, setTimerState, suspend, unlockMethods 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
-
CalendarTimer
-
-
Method Details
-
getSchedule
public jakarta.ejb.ScheduleExpression getSchedule() throws IllegalStateException, jakarta.ejb.EJBException- Specified by:
getSchedulein interfacejakarta.ejb.Timer- Overrides:
getSchedulein classTimerImpl- Throws:
IllegalStateExceptionjakarta.ejb.EJBException- See Also:
-
getScheduleExpression
public jakarta.ejb.ScheduleExpression getScheduleExpression()This method is similar togetSchedule(), except that this method does not check the timer state and hence does not throw eitherIllegalStateExceptionorNoSuchObjectLocalExceptionorEJBException.- Returns:
-
isCalendarTimer
- Specified by:
isCalendarTimerin interfacejakarta.ejb.Timer- Overrides:
isCalendarTimerin classTimerImpl- Throws:
IllegalStateExceptionjakarta.ejb.EJBException
-
getCalendarTimeout
Returns theCalendarBasedTimeoutcorresponding to thisCalendarTimer- Returns:
-
isAutoTimer
public boolean isAutoTimer()Returns true if this is an auto-timer. Else returns false.- Overrides:
isAutoTimerin classTimerImpl
-
getTimerTask
Returns the task which handles the timeouts on thisCalendarTimer- Overrides:
getTimerTaskin classTimerImpl- Returns:
- See Also:
-
getTimeoutMethod
-
builder
-
handleRestorationCalculation
public void handleRestorationCalculation()Makes sure that the timer is only run once after being restored. -
getTimeoutMethod
Returns theMethod, represented by theTimeoutMethodNote: This method uses the
Thread.getContextClassLoader()to load the relevant classes while getting theMethod- Parameters:
timeoutMethodInfo- The timeout methodclassLoader- The class loader- Returns:
- timeout method matching
timeoutMethodInfo
-
toString
A nice formatted string output for this timer . For calendar-based timer, the string output also includes its schedule expression value.
-