public class PersistentEJBTimerService extends NonPersistentEJBTimerService
EJBTimerService.TimerCache
domainName_, ejbContainerUtil, isDas, ownerIdOfThisServer_, STATE_ACTIVE, STATE_CANCELLED, timerCache_, totalTimedObjectsInitialized_
Modifier and Type | Method and Description |
---|---|
protected void |
_createTimer(TimerPrimaryKey timerId,
long containerId,
long applicationId,
Object timedObjectPrimaryKey,
String server_name,
Date initialExpiration,
long intervalDuration,
EJBTimerSchedule schedule,
javax.ejb.TimerConfig timerConfig)
Create persistent timer.
|
protected void |
_destroyTimers(long id,
boolean all) |
protected void |
cancelTimer(TimerPrimaryKey timerId) |
protected void |
cancelTimersByKey(long containerId,
Object primaryKey)
Cancel all timers associated with a particular entity bean identity.This
is typically called when an entity bean is removed.Note that this action
falls under the normal EJB Timer removal semantics, which means it can be
rolled back if the transaction rolls back.
|
void |
createSchedules(long containerId,
long applicationId,
Map<MethodDescriptor,List<ScheduledTimerDescriptor>> methodDescriptorSchedules,
String server_name)
Create automatic timers defined by the @Schedule annotation on the EJB bean during
deployment to a cluster or the first create-application-ref call after deployment
to DAS only.
|
void |
createSchedulesOnServer(EjbDescriptor ejbDescriptor,
String server_name)
Called in a clustered environment to eagerly create automatic persistent timers
on the specific server instance.
|
protected void |
expungeTimer(TimerPrimaryKey timerId,
boolean removeTimerBean)
Remove all traces of a timer.
|
protected Serializable |
getInfo(TimerPrimaryKey timerId) |
protected Date |
getNextTimeout(TimerPrimaryKey timerId)
Return next planned timeout for this timer.We have a fair amount of
leeway regarding the consistency of this information.We should strive to
detect the case where the timer no longer exists.However, since the
current timer instance may not even own this timer, it's difficult to
know the exact time of delivery in another server instance.
|
protected Collection<TimerPrimaryKey> |
getTimerIds(Collection<Long> containerIds)
Return the Ids of active timers owned by EJBs.
|
protected Collection<TimerPrimaryKey> |
getTimerIds(long containerId,
Object timedObjectPrimaryKey)
Use database query to retrieve persistrent timer ids of all active
timers.
|
protected EJBTimerSchedule |
getTimerSchedule(TimerPrimaryKey timerId)
Called by #getScheduleExpression and #isCalendarTimer
|
protected boolean |
isCancelledByAnotherInstance(RuntimeTimerState timerState)
Check if another server instance cancelled this timer.
|
boolean |
isPersistent() |
protected boolean |
isPersistent(TimerPrimaryKey timerId) |
protected boolean |
isValidTimerForThisServer(TimerPrimaryKey timerId,
RuntimeTimerState timerState)
Persistent timers can be cancelled from another server instance
|
String[] |
listTimers(String[] serverIds)
Provide a count of timers owned by each server
|
int |
migrateTimers(String fromOwnerId)
Take ownership of another server's timers.
|
protected Map<TimerPrimaryKey,Method> |
recoverAndCreateSchedules(long containerId,
long applicationId,
Map<Method,List<ScheduledTimerDescriptor>> schedules,
boolean deploy)
Recover pre-existing timers associated with the Container identified
by the containerId, and create automatic timers defined by the @Schedule
annotation on the EJB bean.
|
protected boolean |
redeliverTimeout(RuntimeTimerState timerState) |
protected void |
resetEJBTimers(String target)
Called at server startup *after* user apps have been re-activated to
restart any active EJB timers or cleanup old timers.No-op for
non-persistent timers
|
protected void |
resetLastExpiration(TimerPrimaryKey timerId,
RuntimeTimerState timerState)
Update database for a persistent timer
|
protected boolean |
stopOnFailure() |
protected void |
stopTimers(long containerId)
Remove from the cache and stop all timers associated with a particular
ejb container and known to this server instance.This is typically called
when an ejb is disabled or on a server shutdown to avoid accidentally
removing a valid timer.
|
protected boolean |
timerExists(TimerPrimaryKey timerId) |
cancelNonPersistentTimer, getNonPersistentActiveTimerIdsByThisServer, getNonPersistentTimer, isNonpersistent
_getNextTimeout, addTimerSynchronization, addTimerSynchronization, addToSchedules, calcNextFixedRateExpiration, calcNextFixedRateExpiration, cancelTimerSynchronization, cancelTimerSynchronization, createEJBException, createSchedules, destroyAllTimers, destroyTimers, getContainer, getEJBTimerService, getEJBTimerService, getEJBTimerService, getEJBTimerService, getEJBTimerServiceWrapper, getMaxRedeliveries, getNextScheduledTimeout, getNonPersistentTimerService, getOwnerIdOfThisServer, getPersistentTimerService, getTimerClassLoader, getTimerState, isNonPersistentTimerServiceLoaded, isPersistentTimerServiceLoaded, onShutdown, scheduleTask, setNonPersistentTimerService, setPersistentTimerService, stopTimers, timerStateToString
public String[] listTimers(String[] serverIds)
listTimers
in class EJBTimerService
public int migrateTimers(String fromOwnerId)
migrateTimers
in class NonPersistentEJBTimerService
public boolean isPersistent()
isPersistent
in class NonPersistentEJBTimerService
protected void cancelTimersByKey(long containerId, Object primaryKey)
EJBTimerService
cancelTimersByKey
in class NonPersistentEJBTimerService
protected void stopTimers(long containerId)
EJBTimerService
stopTimers
in class NonPersistentEJBTimerService
protected void _destroyTimers(long id, boolean all)
_destroyTimers
in class EJBTimerService
protected void _createTimer(TimerPrimaryKey timerId, long containerId, long applicationId, Object timedObjectPrimaryKey, String server_name, Date initialExpiration, long intervalDuration, EJBTimerSchedule schedule, javax.ejb.TimerConfig timerConfig) throws Exception
_createTimer
in class EJBTimerService
timedObjectPrimaryKey
- can be null if timed object is not an entity bean.Exception
protected Map<TimerPrimaryKey,Method> recoverAndCreateSchedules(long containerId, long applicationId, Map<Method,List<ScheduledTimerDescriptor>> schedules, boolean deploy)
recoverAndCreateSchedules
in class EJBTimerService
public void createSchedulesOnServer(EjbDescriptor ejbDescriptor, String server_name)
createSchedulesOnServer
in class EJBTimerService
public void createSchedules(long containerId, long applicationId, Map<MethodDescriptor,List<ScheduledTimerDescriptor>> methodDescriptorSchedules, String server_name)
createSchedules
in class EJBTimerService
protected Collection<TimerPrimaryKey> getTimerIds(long containerId, Object timedObjectPrimaryKey)
getTimerIds
in class NonPersistentEJBTimerService
timedObjectPrimaryKey
- can be null if not entity beancontainerId
- the id of the EJB which owns the timersprotected Collection<TimerPrimaryKey> getTimerIds(Collection<Long> containerIds)
getTimerIds
in class NonPersistentEJBTimerService
containerIds
- the EJBs which own the timersprotected void cancelTimer(TimerPrimaryKey timerId) throws javax.ejb.FinderException, Exception
cancelTimer
in class NonPersistentEJBTimerService
javax.ejb.FinderException
Exception
protected Date getNextTimeout(TimerPrimaryKey timerId) throws javax.ejb.FinderException
EJBTimerService
getNextTimeout
in class NonPersistentEJBTimerService
javax.ejb.FinderException
protected Serializable getInfo(TimerPrimaryKey timerId) throws javax.ejb.FinderException
getInfo
in class NonPersistentEJBTimerService
javax.ejb.FinderException
protected boolean isPersistent(TimerPrimaryKey timerId) throws javax.ejb.FinderException
isPersistent
in class NonPersistentEJBTimerService
javax.ejb.FinderException
protected boolean timerExists(TimerPrimaryKey timerId)
timerExists
in class NonPersistentEJBTimerService
protected EJBTimerSchedule getTimerSchedule(TimerPrimaryKey timerId) throws javax.ejb.FinderException
EJBTimerService
getTimerSchedule
in class NonPersistentEJBTimerService
javax.ejb.FinderException
protected boolean isCancelledByAnotherInstance(RuntimeTimerState timerState)
isCancelledByAnotherInstance
in class EJBTimerService
protected boolean redeliverTimeout(RuntimeTimerState timerState)
redeliverTimeout
in class EJBTimerService
protected boolean isValidTimerForThisServer(TimerPrimaryKey timerId, RuntimeTimerState timerState)
isValidTimerForThisServer
in class NonPersistentEJBTimerService
protected void resetLastExpiration(TimerPrimaryKey timerId, RuntimeTimerState timerState)
resetLastExpiration
in class NonPersistentEJBTimerService
protected void expungeTimer(TimerPrimaryKey timerId, boolean removeTimerBean)
EJBTimerService
expungeTimer
in class EJBTimerService
protected boolean stopOnFailure()
stopOnFailure
in class EJBTimerService
protected void resetEJBTimers(String target)
EJBTimerService
resetEJBTimers
in class NonPersistentEJBTimerService
Copyright © 2019. All rights reserved.