public class CalendarTimer extends TimerImpl
Timer
which is created out a calendar expressionhandle, id, info, initialExpiration, intervalDuration, nextExpiration, persistent, previousRun, primaryKey, timedObjectInvoker, timerService, timerState
Constructor and Description |
---|
CalendarTimer(CalendarTimerEntity persistedCalendarTimer,
TimerServiceImpl timerService)
Constructs a
CalendarTimer from a persistent state |
CalendarTimer(String id,
TimerServiceImpl timerService,
CalendarBasedTimeout calendarTimeout,
Object primaryKey)
Constructs a
CalendarTimer |
CalendarTimer(String id,
TimerServiceImpl timerService,
CalendarBasedTimeout calendarTimeout,
Serializable info,
boolean persistent,
Method timeoutMethod,
Object primaryKey)
Constructs a
CalendarTimer |
CalendarTimer(String id,
TimerServiceImpl timerService,
CalendarBasedTimeout calendarTimeout,
Serializable info,
boolean persistent,
Object primaryKey)
Constructs a
CalendarTimer |
Modifier and Type | Method and Description |
---|---|
protected TimerEntity |
createPersistentState()
Creates and return a new persistent state of this timer
|
boolean |
equals(Object obj)
A
Timer is equal to another Timer if their
TimerHandle s are equal |
CalendarBasedTimeout |
getCalendarTimeout()
Returns the
CalendarBasedTimeout corresponding to this
CalendarTimer |
javax.ejb.ScheduleExpression |
getSchedule() |
javax.ejb.ScheduleExpression |
getScheduleExpression()
This method is similar to
getSchedule() , except that this method does not check the timer state
and hence does not throw either IllegalStateException or NoSuchObjectLocalException
or EJBException . |
Method |
getTimeoutMethod() |
protected TimerTask<?> |
getTimerTask()
Returns the task which handles the timeouts on this
CalendarTimer |
int |
hashCode() |
boolean |
isAutoTimer()
Returns true if this is an auto-timer.
|
boolean |
isCalendarTimer() |
assertTimerState, cancel, cancelTimeout, expireTimer, getHandle, getId, getInfo, getInitialExpiration, getInterval, getNextExpiration, getNextTimeout, getPersistentState, getPreviousRun, getPrimaryKey, getState, getTimedObjectId, getTimeRemaining, getTimerHandle, getTimerInfo, getTimerService, isActive, isCanceled, isExpired, isInRetry, isPersistent, scheduleTimeout, setNextTimeout, setPreviousRun, setTimerState, suspend, toString
public CalendarTimer(String id, TimerServiceImpl timerService, CalendarBasedTimeout calendarTimeout, Object primaryKey)
CalendarTimer
id
- The id of this timertimerService
- The timer service to which this timer belongscalendarTimeout
- The CalendarBasedTimeout
from which this CalendarTimer
is being createdpublic CalendarTimer(String id, TimerServiceImpl timerService, CalendarBasedTimeout calendarTimeout, Serializable info, boolean persistent, Object primaryKey)
CalendarTimer
id
- The id of this timertimerService
- The timer service to which this timer belongscalendarTimeout
- The CalendarBasedTimeout
from which this CalendarTimer
is being createdinfo
- The serializable info which will be made available through Timer.getInfo()
persistent
- True if this timer is persistent. False otherwisepublic CalendarTimer(String id, TimerServiceImpl timerService, CalendarBasedTimeout calendarTimeout, Serializable info, boolean persistent, Method timeoutMethod, Object primaryKey)
CalendarTimer
id
- The id of this timertimerService
- The timer service to which this timer belongscalendarTimeout
- The CalendarBasedTimeout
from which this CalendarTimer
is being createdinfo
- The serializable info which will be made available through Timer.getInfo()
persistent
- True if this timer is persistent. False otherwisetimeoutMethod
- If this is a non-null value, then this CalendarTimer
is marked as an auto-timer.
This timeoutMethod
is then considered as the name of the timeout method which has to
be invoked when this timer times out.public CalendarTimer(CalendarTimerEntity persistedCalendarTimer, TimerServiceImpl timerService)
CalendarTimer
from a persistent statepersistedCalendarTimer
- The persistent state of the calendar timertimerService
- The timer service to which this timer belongspublic javax.ejb.ScheduleExpression getSchedule() throws IllegalStateException, javax.ejb.EJBException
getSchedule
in interface javax.ejb.Timer
getSchedule
in class TimerImpl
IllegalStateException
javax.ejb.EJBException
getScheduleExpression()
public javax.ejb.ScheduleExpression getScheduleExpression()
getSchedule()
, except that this method does not check the timer state
and hence does not throw either IllegalStateException
or NoSuchObjectLocalException
or EJBException
.public boolean isCalendarTimer() throws IllegalStateException, javax.ejb.EJBException
isCalendarTimer
in interface javax.ejb.Timer
isCalendarTimer
in class TimerImpl
IllegalStateException
javax.ejb.EJBException
protected TimerEntity createPersistentState()
createPersistentState
in class TimerImpl
public CalendarBasedTimeout getCalendarTimeout()
CalendarBasedTimeout
corresponding to this
CalendarTimer
public boolean isAutoTimer()
isAutoTimer
in class TimerImpl
protected TimerTask<?> getTimerTask()
CalendarTimer
getTimerTask
in class TimerImpl
CalendarTimerTask
public Method getTimeoutMethod()
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.