public class EjbTimerServiceImpl extends java.lang.Object implements EjbTimerService, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EJB_TIMER_RETRY_ATTEMPTS |
static java.lang.String |
OPENEJB_QUARTZ_USE_TCCL |
static java.lang.String |
OPENEJB_TIMEOUT_JOB_GROUP_NAME |
static java.lang.String |
OPENEJB_TIMEOUT_JOB_NAME |
static java.lang.String |
QUARTZ_JMX |
static java.lang.String |
QUARTZ_MAKE_SCHEDULER_THREAD_DAEMON |
| Constructor and Description |
|---|
EjbTimerServiceImpl(BeanContext deployment,
TimerStore timerStore) |
EjbTimerServiceImpl(BeanContext deployment,
TransactionManager transactionManager,
TimerStore timerStore,
int retryAttempts) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTimerData(TimerData timerData)
Returns a timerData to the TimerStore, if a cancel() is rolled back.
|
void |
cancelled(TimerData timerData)
Call back from TimerData and ejbTimeout when a timer has been cancelled (or is complete) and should be removed from stores.
|
Timer |
createTimer(java.lang.Object primaryKey,
java.lang.reflect.Method timeoutMethod,
java.util.Date initialExpiration,
long intervalDuration,
TimerConfig timerConfig) |
Timer |
createTimer(java.lang.Object primaryKey,
java.lang.reflect.Method timeoutMethod,
java.util.Date expiration,
TimerConfig timerConfig) |
Timer |
createTimer(java.lang.Object primaryKey,
java.lang.reflect.Method timeoutMethod,
long initialDuration,
long intervalDuration,
TimerConfig timerConfig) |
Timer |
createTimer(java.lang.Object primaryKey,
java.lang.reflect.Method timeoutMethod,
long duration,
TimerConfig timerConfig) |
Timer |
createTimer(java.lang.Object primaryKey,
java.lang.reflect.Method timeoutMethod,
ScheduleExpression scheduleExpression,
TimerConfig timerConfig) |
void |
ejbTimeout(TimerData timerData)
This method calls the ejbTimeout method and starts a transaction if the timeout is transacted.
|
static Scheduler |
getDefaultScheduler(BeanContext deployment) |
static TransactionManager |
getDefaultTransactionManager() |
Scheduler |
getScheduler() |
Timer |
getTimer(long timerId) |
java.util.Collection<Timer> |
getTimers(java.lang.Object primaryKey) |
TimerStore |
getTimerStore() |
TransactionManager |
getTransactionManager() |
boolean |
isStarted() |
void |
schedule(TimerData timerData)
Called from TimerData and start when a timer should be scheduled with the java.util.Timer.
|
static void |
shutdown() |
void |
start() |
void |
stop() |
public static final java.lang.String QUARTZ_JMX
public static final java.lang.String QUARTZ_MAKE_SCHEDULER_THREAD_DAEMON
public static final java.lang.String OPENEJB_TIMEOUT_JOB_NAME
public static final java.lang.String OPENEJB_TIMEOUT_JOB_GROUP_NAME
public static final java.lang.String EJB_TIMER_RETRY_ATTEMPTS
public static final java.lang.String OPENEJB_QUARTZ_USE_TCCL
public EjbTimerServiceImpl(BeanContext deployment, TimerStore timerStore)
public EjbTimerServiceImpl(BeanContext deployment, TransactionManager transactionManager, TimerStore timerStore, int retryAttempts)
public static TransactionManager getDefaultTransactionManager()
public static Scheduler getDefaultScheduler(BeanContext deployment)
public void stop()
stop in interface EjbTimerServicepublic static void shutdown()
public void start()
throws TimerStoreException
start in interface EjbTimerServiceTimerStoreExceptionpublic TransactionManager getTransactionManager()
public void schedule(TimerData timerData) throws TimerStoreException
timerData - the timer to scheduleTimerStoreExceptionpublic void cancelled(TimerData timerData)
timerData - the timer that was cancelledpublic void addTimerData(TimerData timerData)
timerData - the timer to be returned to the timer storepublic Timer getTimer(long timerId)
getTimer in interface EjbTimerServicepublic java.util.Collection<Timer> getTimers(java.lang.Object primaryKey)
throws java.lang.IllegalStateException
getTimers in interface EjbTimerServicejava.lang.IllegalStateExceptionpublic Timer createTimer(java.lang.Object primaryKey,
java.lang.reflect.Method timeoutMethod,
long duration,
TimerConfig timerConfig)
throws java.lang.IllegalArgumentException,
java.lang.IllegalStateException,
EJBException
createTimer in interface EjbTimerServicejava.lang.IllegalArgumentExceptionjava.lang.IllegalStateExceptionEJBExceptionpublic Timer createTimer(java.lang.Object primaryKey,
java.lang.reflect.Method timeoutMethod,
long initialDuration,
long intervalDuration,
TimerConfig timerConfig)
throws java.lang.IllegalArgumentException,
java.lang.IllegalStateException,
EJBException
createTimer in interface EjbTimerServicejava.lang.IllegalArgumentExceptionjava.lang.IllegalStateExceptionEJBExceptionpublic Timer createTimer(java.lang.Object primaryKey,
java.lang.reflect.Method timeoutMethod,
java.util.Date expiration,
TimerConfig timerConfig)
throws java.lang.IllegalArgumentException,
java.lang.IllegalStateException,
EJBException
createTimer in interface EjbTimerServicejava.lang.IllegalArgumentExceptionjava.lang.IllegalStateExceptionEJBExceptionpublic Timer createTimer(java.lang.Object primaryKey,
java.lang.reflect.Method timeoutMethod,
java.util.Date initialExpiration,
long intervalDuration,
TimerConfig timerConfig)
throws java.lang.IllegalArgumentException,
java.lang.IllegalStateException,
EJBException
createTimer in interface EjbTimerServicejava.lang.IllegalArgumentExceptionjava.lang.IllegalStateExceptionEJBExceptionpublic Timer createTimer(java.lang.Object primaryKey,
java.lang.reflect.Method timeoutMethod,
ScheduleExpression scheduleExpression,
TimerConfig timerConfig)
createTimer in interface EjbTimerServicepublic TimerStore getTimerStore()
getTimerStore in interface EjbTimerServicepublic boolean isStarted()
isStarted in interface EjbTimerServicepublic Scheduler getScheduler()
public void ejbTimeout(TimerData timerData)
timerData - the timer to call.