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:
javax.ejb.Timer
public class CalendarTimer extends TimerImpl
Represents aTimerwhich is created out a calendar expression- Version:
- $Revision: $
- Author:
- Jaikiran Pai
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCalendarTimer.Builder
-
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 Constructor Description CalendarTimer(CalendarTimer.Builder builder, TimerServiceImpl timerService)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CalendarTimer.Builderbuilder()CalendarBasedTimeoutgetCalendarTimeout()Returns theCalendarBasedTimeoutcorresponding to thisCalendarTimerjavax.ejb.ScheduleExpressiongetSchedule()javax.ejb.ScheduleExpressiongetScheduleExpression()This method is similar togetSchedule(), except that this method does not check the timer state and hence does not throw eitherIllegalStateExceptionorNoSuchObjectLocalExceptionorEJBException.MethodgetTimeoutMethod()static MethodgetTimeoutMethod(TimeoutMethod timeoutMethodInfo, ClassLoader classLoader)Returns theMethod, represented by theTimeoutMethodprotected CalendarTimerTaskgetTimerTask()Returns the task which handles the timeouts on thisCalendarTimervoidhandleRestorationCalculation()Makes sure that the timer is only run once after being restored.booleanisAutoTimer()Returns true if this is an auto-timer.booleanisCalendarTimer()StringtoString()A nice formatted string output for this timer-
Methods inherited from class org.jboss.as.ejb3.timerservice.TimerImpl
assertTimerState, cancel, equals, getCachedTimerInfo, getExecutingThread, getHandle, getId, getInfo, getInitialExpiration, getInterval, getNextExpiration, getNextTimeout, getPreviousRun, getState, getTimedObjectId, getTimeRemaining, getTimerInfo, getTimerService, hashCode, invokeOneOff, isActive, isCanceled, isExpired, isInRetry, isPersistent, lock, scheduleTimeout, setCachedTimerInfo, setNextTimeout, setPreviousRun, setTimerState, suspend, unlock
-
-
-
-
Constructor Detail
-
CalendarTimer
public CalendarTimer(CalendarTimer.Builder builder, TimerServiceImpl timerService)
-
-
Method Detail
-
getSchedule
public javax.ejb.ScheduleExpression getSchedule() throws IllegalStateException, javax.ejb.EJBException- Specified by:
getSchedulein interfacejavax.ejb.Timer- Overrides:
getSchedulein classTimerImpl- Throws:
IllegalStateExceptionjavax.ejb.EJBException- See Also:
getScheduleExpression()
-
getScheduleExpression
public javax.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
public boolean isCalendarTimer() throws IllegalStateException, javax.ejb.EJBException- Specified by:
isCalendarTimerin interfacejavax.ejb.Timer- Overrides:
isCalendarTimerin classTimerImpl- Throws:
IllegalStateExceptionjavax.ejb.EJBException
-
getCalendarTimeout
public CalendarBasedTimeout 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
protected CalendarTimerTask getTimerTask()
Returns the task which handles the timeouts on thisCalendarTimer- Overrides:
getTimerTaskin classTimerImpl- Returns:
- See Also:
CalendarTimerTask
-
getTimeoutMethod
public Method getTimeoutMethod()
-
builder
public static CalendarTimer.Builder builder()
-
handleRestorationCalculation
public void handleRestorationCalculation()
Makes sure that the timer is only run once after being restored.
-
getTimeoutMethod
public static Method getTimeoutMethod(TimeoutMethod timeoutMethodInfo, ClassLoader classLoader)
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
-
-