public class HazelcastTimerStore extends EJBTimerService
EJBTimerService.TimerCache
domainName_, 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.
|
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.
|
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.
|
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.
|
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.
|
protected boolean |
timerExists(TimerPrimaryKey timerId) |
_destroyTimers, _getNextTimeout, addTimerSynchronization, addTimerSynchronization, addToSchedules, calcNextFixedRateExpiration, calcNextFixedRateExpiration, cancelNonPersistentTimer, cancelTimerSynchronization, createEJBException, createSchedules, getContainer, getEJBTimerService, getEJBTimerService, getEJBTimerService, getMaxRedeliveries, getNextScheduledTimeout, getNonPersistentActiveTimerIdsByThisServer, getNonPersistentTimer, getOwnerIdOfThisServer, getTimerClassLoader, getTimerState, getValidEJBTimerService, isEJBTimerServiceLoaded, onShutdown, scheduleTask, setEJBTimerService, stopTimers, timerStateToString
public HazelcastTimerStore(HazelcastCore core) throws Exception
Exception
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
public void destroyAllTimers(long applicationId)
EJBTimerService
destroyAllTimers
in class EJBTimerService
public void destroyTimers(long containerId)
EJBTimerService
destroyTimers
in class EJBTimerService
protected void cancelTimer(TimerPrimaryKey timerId) throws javax.ejb.FinderException, Exception
cancelTimer
in class EJBTimerService
javax.ejb.FinderException
Exception
protected Serializable getInfo(TimerPrimaryKey timerId) throws javax.ejb.FinderException
getInfo
in class EJBTimerService
javax.ejb.FinderException
protected Date getNextTimeout(TimerPrimaryKey timerId) throws javax.ejb.FinderException
EJBTimerService
getNextTimeout
in class EJBTimerService
javax.ejb.FinderException
protected void cancelTimersByKey(long containerId, Object primaryKey)
EJBTimerService
cancelTimersByKey
in class EJBTimerService
public void createSchedules(long containerId, long applicationId, Map<MethodDescriptor,List<ScheduledTimerDescriptor>> methodDescriptorSchedules, String server_name)
EJBTimerService
createSchedules
in class EJBTimerService
public void createSchedulesOnServer(EjbDescriptor ejbDescriptor, String server_name)
EJBTimerService
createSchedulesOnServer
in class EJBTimerService
protected void expungeTimer(TimerPrimaryKey timerId, boolean removeTimerBean)
EJBTimerService
expungeTimer
in class EJBTimerService
protected Collection<TimerPrimaryKey> getTimerIds(Collection<Long> containerIds)
getTimerIds
in class EJBTimerService
containerIds
- the EJBs which own the timersprotected Collection<TimerPrimaryKey> getTimerIds(long containerId, Object timedObjectPrimaryKey)
EJBTimerService
getTimerIds
in class EJBTimerService
containerId
- the id of the EJB which owns the timerstimedObjectPrimaryKey
- can be null if not entity beanprotected EJBTimerSchedule getTimerSchedule(TimerPrimaryKey timerId) throws javax.ejb.FinderException
EJBTimerService
getTimerSchedule
in class EJBTimerService
javax.ejb.FinderException
public boolean isPersistent()
isPersistent
in class EJBTimerService
protected boolean isCancelledByAnotherInstance(RuntimeTimerState timerState)
EJBTimerService
isCancelledByAnotherInstance
in class EJBTimerService
protected boolean isPersistent(TimerPrimaryKey timerId) throws javax.ejb.FinderException
isPersistent
in class EJBTimerService
javax.ejb.FinderException
protected boolean isValidTimerForThisServer(TimerPrimaryKey timerId, RuntimeTimerState timerState)
EJBTimerService
isValidTimerForThisServer
in class EJBTimerService
public String[] listTimers(String[] serverIds)
EJBTimerService
listTimers
in class EJBTimerService
public int migrateTimers(String fromOwnerId)
EJBTimerService
migrateTimers
in class EJBTimerService
protected Map<TimerPrimaryKey,Method> recoverAndCreateSchedules(long containerId, long applicationId, Map<Method,List<ScheduledTimerDescriptor>> schedules, boolean deploy)
EJBTimerService
recoverAndCreateSchedules
in class EJBTimerService
protected boolean redeliverTimeout(RuntimeTimerState timerState)
redeliverTimeout
in class EJBTimerService
protected void resetLastExpiration(TimerPrimaryKey timerId, RuntimeTimerState timerState)
EJBTimerService
resetLastExpiration
in class EJBTimerService
protected void resetEJBTimers(String target)
EJBTimerService
resetEJBTimers
in class EJBTimerService
protected boolean stopOnFailure()
stopOnFailure
in class EJBTimerService
protected boolean timerExists(TimerPrimaryKey timerId)
timerExists
in class EJBTimerService
protected void stopTimers(long containerId)
EJBTimerService
stopTimers
in class EJBTimerService
Copyright © 2018. All rights reserved.