public class DatabaseTimerPersistence extends Object implements TimerPersistence, org.jboss.msc.service.Service<DatabaseTimerPersistence>
Database timer persistence store.
TimerPersistence.TimerChangeListenerSERVICE_NAME| Constructor and Description |
|---|
DatabaseTimerPersistence(String database,
String partition,
String nodeName,
int refreshInterval,
boolean allowExecution) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTimer(TimerImpl timerEntity)
Called when a timer is being persisted
|
Object |
deSerialize(String data) |
org.jboss.msc.value.InjectedValue<org.jboss.as.naming.ManagedReferenceFactory> |
getDataSourceInjectedValue() |
org.jboss.msc.value.InjectedValue<org.jboss.modules.ModuleLoader> |
getModuleLoader() |
org.jboss.msc.value.InjectedValue<Timer> |
getTimerInjectedValue() |
DatabaseTimerPersistence |
getValue() |
List<TimerImpl> |
loadActiveTimers(String timedObjectId,
TimerServiceImpl timerService)
Load all active timers for the given object.
|
void |
persistTimer(TimerImpl timerEntity)
Called when a timer is being persisted
|
Closeable |
registerChangeListener(String timedObjectId,
TimerPersistence.TimerChangeListener listener)
Registers a listener to listed for new timers that are added to the database.
|
boolean |
shouldRun(TimerImpl timer,
TransactionManager ignored)
Invoked before running a timer in order to determine if this node should run the timer.
|
void |
start(org.jboss.msc.service.StartContext context) |
void |
stop(org.jboss.msc.service.StopContext context) |
void |
timerUndeployed(String timedObjectId)
Signals that a timer is being undeployed, and all cached data relating to this object should
be dropped to prevent a class loader leak
|
public void start(org.jboss.msc.service.StartContext context)
throws org.jboss.msc.service.StartException
start in interface org.jboss.msc.Serviceorg.jboss.msc.service.StartExceptionpublic void stop(org.jboss.msc.service.StopContext context)
stop in interface org.jboss.msc.Servicepublic void addTimer(TimerImpl timerEntity)
TimerPersistenceaddTimer in interface TimerPersistencetimerEntity - The timerpublic void persistTimer(TimerImpl timerEntity)
TimerPersistencepersistTimer in interface TimerPersistencetimerEntity - The timerpublic boolean shouldRun(TimerImpl timer, @Deprecated TransactionManager ignored)
TimerPersistenceshouldRun in interface TimerPersistencetimer - The timerignored - ignoredpublic void timerUndeployed(String timedObjectId)
TimerPersistencetimerUndeployed in interface TimerPersistencepublic List<TimerImpl> loadActiveTimers(String timedObjectId, TimerServiceImpl timerService)
TimerPersistenceloadActiveTimers in interface TimerPersistencetimedObjectId - The timed object id to load timers forpublic Closeable registerChangeListener(String timedObjectId, TimerPersistence.TimerChangeListener listener)
TimerPersistenceregisterChangeListener in interface TimerPersistencetimedObjectId - The timed objectlistener - The listenerpublic DatabaseTimerPersistence getValue() throws IllegalStateException, IllegalArgumentException
getValue in interface org.jboss.msc.value.Value<DatabaseTimerPersistence>IllegalStateExceptionIllegalArgumentExceptionpublic Object deSerialize(String data) throws SQLException
SQLExceptionpublic org.jboss.msc.value.InjectedValue<org.jboss.as.naming.ManagedReferenceFactory> getDataSourceInjectedValue()
public org.jboss.msc.value.InjectedValue<org.jboss.modules.ModuleLoader> getModuleLoader()
public org.jboss.msc.value.InjectedValue<Timer> getTimerInjectedValue()
Copyright © 2018 JBoss by Red Hat. All rights reserved.