public class FileTimerPersistence extends Object implements TimerPersistence, org.jboss.msc.service.Service<FileTimerPersistence>
TimerPersistence.TimerChangeListener
SERVICE_NAME
Constructor and Description |
---|
FileTimerPersistence(boolean createIfNotExists,
String path,
String pathRelativeTo) |
Modifier and Type | Method and Description |
---|---|
void |
addTimer(TimerImpl TimerImpl)
Called when a timer is being persisted
|
static org.jboss.staxmapper.XMLExtendedStreamWriter |
create(XMLStreamWriter writer) |
org.jboss.msc.value.InjectedValue<org.jboss.modules.ModuleLoader> |
getModuleLoader() |
org.jboss.msc.value.InjectedValue<org.jboss.as.controller.services.path.PathManager> |
getPathManager() |
org.jboss.msc.value.InjectedValue<TransactionManager> |
getTransactionManager() |
org.jboss.msc.value.InjectedValue<TransactionSynchronizationRegistry> |
getTransactionSynchronizationRegistry() |
FileTimerPersistence |
getValue() |
List<TimerImpl> |
loadActiveTimers(String timedObjectId,
TimerServiceImpl timerService)
Load all active timers for the given object.
|
void |
persistTimer(TimerImpl TimerImpl)
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 tm)
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)
start
in interface org.jboss.msc.service.Service<FileTimerPersistence>
public void stop(org.jboss.msc.service.StopContext context)
stop
in interface org.jboss.msc.service.Service<FileTimerPersistence>
public FileTimerPersistence getValue() throws IllegalStateException, IllegalArgumentException
getValue
in interface org.jboss.msc.value.Value<FileTimerPersistence>
IllegalStateException
IllegalArgumentException
public void addTimer(TimerImpl TimerImpl)
TimerPersistence
addTimer
in interface TimerPersistence
TimerImpl
- The timerpublic void persistTimer(TimerImpl TimerImpl)
TimerPersistence
persistTimer
in interface TimerPersistence
TimerImpl
- The timerpublic boolean shouldRun(TimerImpl timer, TransactionManager tm)
TimerPersistence
shouldRun
in interface TimerPersistence
timer
- The timertm
- Transaction manager to be able to create a transactionpublic void timerUndeployed(String timedObjectId)
TimerPersistence
timerUndeployed
in interface TimerPersistence
public List<TimerImpl> loadActiveTimers(String timedObjectId, TimerServiceImpl timerService)
TimerPersistence
loadActiveTimers
in interface TimerPersistence
timedObjectId
- The timed object id to load timers forpublic Closeable registerChangeListener(String timedObjectId, TimerPersistence.TimerChangeListener listener)
TimerPersistence
registerChangeListener
in interface TimerPersistence
timedObjectId
- The timed objectlistener
- The listenerpublic org.jboss.msc.value.InjectedValue<TransactionManager> getTransactionManager()
public org.jboss.msc.value.InjectedValue<TransactionSynchronizationRegistry> getTransactionSynchronizationRegistry()
public org.jboss.msc.value.InjectedValue<org.jboss.modules.ModuleLoader> getModuleLoader()
public org.jboss.msc.value.InjectedValue<org.jboss.as.controller.services.path.PathManager> getPathManager()
public static org.jboss.staxmapper.XMLExtendedStreamWriter create(XMLStreamWriter writer) throws Exception
Exception
Copyright © 2017 JBoss by Red Hat. All rights reserved.