public class HazelcastTimerStore extends NonPersistentEJBTimerService
EJBTimerService.TimerCachedomainName_, ejbContainerUtil, isDas, ownerIdOfThisServer_, STATE_ACTIVE, STATE_CANCELLED, timerCache_, totalTimedObjectsInitialized_| Constructor and Description |
|---|
HazelcastTimerStore(HazelcastCore core) |
| 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) |
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.
|
void |
destroyAllTimers(long applicationId)
Destroy all timers associated with a particular application.
|
void |
destroyTimers(long containerId)
Destroy all timers associated with a particular ejb container
This is typically called when an ejb is undeployed.
|
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) |
protected Collection<TimerPrimaryKey> |
getTimerIds(long containerId,
Object timedObjectPrimaryKey)
Called by EJBTimerServiceWrapper when caller calls getTimers.
|
protected EJBTimerSchedule |
getTimerSchedule(TimerPrimaryKey timerId)
Called by #getScheduleExpression and #isCalendarTimer
|
protected boolean |
isCancelledByAnotherInstance(RuntimeTimerState timerState)
For a non-persistent timer, it's not possible to be cancelled by another
server instance
|
boolean |
isPersistent() |
protected boolean |
isPersistent(TimerPrimaryKey timerId) |
protected boolean |
isValidTimerForThisServer(TimerPrimaryKey timerId,
RuntimeTimerState timerState)
Non-persistent timers are always valid because to be executed on this
server instance.
|
String[] |
listTimers(String[] serverIds)
Provide a count of timers owned by each server.
|
int |
migrateTimers(String fromOwnerId)
Called by CLI.Take ownership of another server's timers.
|
protected Map<TimerPrimaryKey,Method> |
recoverAndCreateSchedules(long containerId,
long applicationId,
Map<Method,List<ScheduledTimerDescriptor>> schedules,
boolean deploy)
Create automatic non-persistent 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)
Nothing special to do for non-persistent timers
|
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_destroyTimers, _getNextTimeout, addTimerSynchronization, addTimerSynchronization, addToSchedules, calcNextFixedRateExpiration, calcNextFixedRateExpiration, cancelTimerSynchronization, cancelTimerSynchronization, createEJBException, createSchedules, getContainer, getEJBTimerService, getEJBTimerService, getEJBTimerService, getEJBTimerService, getEJBTimerServiceWrapper, getMaxRedeliveries, getNextScheduledTimeout, getNonPersistentTimerService, getOwnerIdOfThisServer, getPersistentTimerService, getTimerClassLoader, getTimerState, isNonPersistentTimerServiceLoaded, isPersistentTimerServiceLoaded, onShutdown, scheduleTask, setNonPersistentTimerService, setPersistentTimerService, stopTimers, timerStateToStringpublic HazelcastTimerStore(HazelcastCore core) throws Exception
Exceptionprotected 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 EJBTimerServicetimedObjectPrimaryKey - can be null if timed object is not an entity bean.Exceptionpublic void destroyAllTimers(long applicationId)
EJBTimerServicedestroyAllTimers in class EJBTimerServicepublic void destroyTimers(long containerId)
EJBTimerServicedestroyTimers in class EJBTimerServiceprotected void cancelTimer(TimerPrimaryKey timerId) throws javax.ejb.FinderException, Exception
cancelTimer in class NonPersistentEJBTimerServicejavax.ejb.FinderExceptionExceptionprotected Serializable getInfo(TimerPrimaryKey timerId) throws javax.ejb.FinderException
getInfo in class NonPersistentEJBTimerServicejavax.ejb.FinderExceptionprotected Date getNextTimeout(TimerPrimaryKey timerId) throws javax.ejb.FinderException
EJBTimerServicegetNextTimeout in class NonPersistentEJBTimerServicejavax.ejb.FinderExceptionprotected void cancelTimersByKey(long containerId,
Object primaryKey)
EJBTimerServicecancelTimersByKey in class NonPersistentEJBTimerServicepublic void createSchedules(long containerId,
long applicationId,
Map<MethodDescriptor,List<ScheduledTimerDescriptor>> methodDescriptorSchedules,
String server_name)
EJBTimerServicecreateSchedules in class EJBTimerServicepublic void createSchedulesOnServer(EjbDescriptor ejbDescriptor, String server_name)
EJBTimerServicecreateSchedulesOnServer in class EJBTimerServiceprotected void expungeTimer(TimerPrimaryKey timerId, boolean removeTimerBean)
EJBTimerServiceexpungeTimer in class EJBTimerServiceprotected Collection<TimerPrimaryKey> getTimerIds(Collection<Long> containerIds)
getTimerIds in class NonPersistentEJBTimerServicecontainerIds - the EJBs which own the timersprotected Collection<TimerPrimaryKey> getTimerIds(long containerId, Object timedObjectPrimaryKey)
EJBTimerServicegetTimerIds in class NonPersistentEJBTimerServicecontainerId - the id of the EJB which owns the timerstimedObjectPrimaryKey - can be null if not entity beanprotected EJBTimerSchedule getTimerSchedule(TimerPrimaryKey timerId) throws javax.ejb.FinderException
EJBTimerServicegetTimerSchedule in class NonPersistentEJBTimerServicejavax.ejb.FinderExceptionpublic boolean isPersistent()
isPersistent in class NonPersistentEJBTimerServiceprotected boolean isCancelledByAnotherInstance(RuntimeTimerState timerState)
EJBTimerServiceisCancelledByAnotherInstance in class EJBTimerServiceprotected boolean isPersistent(TimerPrimaryKey timerId) throws javax.ejb.FinderException
isPersistent in class NonPersistentEJBTimerServicejavax.ejb.FinderExceptionprotected boolean isValidTimerForThisServer(TimerPrimaryKey timerId, RuntimeTimerState timerState)
EJBTimerServiceisValidTimerForThisServer in class NonPersistentEJBTimerServicepublic String[] listTimers(String[] serverIds)
EJBTimerServicelistTimers in class EJBTimerServicepublic int migrateTimers(String fromOwnerId)
EJBTimerServicemigrateTimers in class NonPersistentEJBTimerServiceprotected Map<TimerPrimaryKey,Method> recoverAndCreateSchedules(long containerId, long applicationId, Map<Method,List<ScheduledTimerDescriptor>> schedules, boolean deploy)
EJBTimerServicerecoverAndCreateSchedules in class EJBTimerServiceprotected boolean redeliverTimeout(RuntimeTimerState timerState)
redeliverTimeout in class EJBTimerServiceprotected void resetLastExpiration(TimerPrimaryKey timerId, RuntimeTimerState timerState)
EJBTimerServiceresetLastExpiration in class NonPersistentEJBTimerServiceprotected void resetEJBTimers(String target)
EJBTimerServiceresetEJBTimers in class NonPersistentEJBTimerServiceprotected boolean stopOnFailure()
stopOnFailure in class EJBTimerServiceprotected boolean timerExists(TimerPrimaryKey timerId)
timerExists in class NonPersistentEJBTimerServiceprotected void stopTimers(long containerId)
EJBTimerServicestopTimers in class NonPersistentEJBTimerServiceCopyright © 2019. All rights reserved.