org.apache.openejb.core.timer
Class EjbTimerServiceImpl
java.lang.Object
org.apache.openejb.core.timer.EjbTimerServiceImpl
- All Implemented Interfaces:
- EjbTimerService
public class EjbTimerServiceImpl
- extends Object
- implements EjbTimerService
|
Method Summary |
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. |
javax.ejb.Timer |
createTimer(Object primaryKey,
Method timeoutMethod,
Date initialExpiration,
long intervalDuration,
javax.ejb.TimerConfig timerConfig)
|
javax.ejb.Timer |
createTimer(Object primaryKey,
Method timeoutMethod,
Date expiration,
javax.ejb.TimerConfig timerConfig)
|
javax.ejb.Timer |
createTimer(Object primaryKey,
Method timeoutMethod,
long initialDuration,
long intervalDuration,
javax.ejb.TimerConfig timerConfig)
|
javax.ejb.Timer |
createTimer(Object primaryKey,
Method timeoutMethod,
long duration,
javax.ejb.TimerConfig timerConfig)
|
javax.ejb.Timer |
createTimer(Object primaryKey,
Method timeoutMethod,
javax.ejb.ScheduleExpression scheduleExpression,
javax.ejb.TimerConfig timerConfig)
|
void |
ejbTimeout(TimerData timerData)
This method calls the ejbTimeout method and starts a transaction if the timeout is transacted. |
static org.quartz.Scheduler |
getDefaultScheduler()
|
static TransactionManager |
getDefaultTransactionManager()
|
org.quartz.Scheduler |
getScheduler()
|
javax.ejb.Timer |
getTimer(long timerId)
|
Collection<javax.ejb.Timer> |
getTimers(Object primaryKey)
|
TimerStore |
getTimerStore()
|
TransactionManager |
getTransactionManager()
|
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()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QUARTZ_THREAD_POOL_ADAPTER
public static final String QUARTZ_THREAD_POOL_ADAPTER
- See Also:
- Constant Field Values
OPENEJB_TIMEOUT_JOB_NAME
public static final String OPENEJB_TIMEOUT_JOB_NAME
- See Also:
- Constant Field Values
OPENEJB_TIMEOUT_JOB_GROUP_NAME
public static final String OPENEJB_TIMEOUT_JOB_GROUP_NAME
- See Also:
- Constant Field Values
EjbTimerServiceImpl
public EjbTimerServiceImpl(BeanContext deployment)
EjbTimerServiceImpl
public EjbTimerServiceImpl(BeanContext deployment,
TransactionManager transactionManager,
org.quartz.Scheduler scheduler,
TimerStore timerStore,
int retryAttempts)
getDefaultTransactionManager
public static TransactionManager getDefaultTransactionManager()
getDefaultScheduler
public static org.quartz.Scheduler getDefaultScheduler()
shutdown
public static void shutdown()
start
public void start()
throws TimerStoreException
- Specified by:
start in interface EjbTimerService
- Throws:
TimerStoreException
stop
public void stop()
- Specified by:
stop in interface EjbTimerService
getTransactionManager
public TransactionManager getTransactionManager()
schedule
public void schedule(TimerData timerData)
- Called from TimerData and start when a timer should be scheduled with the java.util.Timer.
- Parameters:
timerData - the timer to schedule
cancelled
public 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.
- Parameters:
timerData - the timer that was cancelled
addTimerData
public void addTimerData(TimerData timerData)
- Returns a timerData to the TimerStore, if a cancel() is rolled back.
- Parameters:
timerData - the timer to be returned to the timer store
getTimer
public javax.ejb.Timer getTimer(long timerId)
- Specified by:
getTimer in interface EjbTimerService
getTimers
public Collection<javax.ejb.Timer> getTimers(Object primaryKey)
throws IllegalStateException
- Specified by:
getTimers in interface EjbTimerService
- Throws:
IllegalStateException
createTimer
public javax.ejb.Timer createTimer(Object primaryKey,
Method timeoutMethod,
long duration,
javax.ejb.TimerConfig timerConfig)
throws IllegalArgumentException,
IllegalStateException,
javax.ejb.EJBException
- Specified by:
createTimer in interface EjbTimerService
- Throws:
IllegalArgumentException
IllegalStateException
javax.ejb.EJBException
createTimer
public javax.ejb.Timer createTimer(Object primaryKey,
Method timeoutMethod,
long initialDuration,
long intervalDuration,
javax.ejb.TimerConfig timerConfig)
throws IllegalArgumentException,
IllegalStateException,
javax.ejb.EJBException
- Specified by:
createTimer in interface EjbTimerService
- Throws:
IllegalArgumentException
IllegalStateException
javax.ejb.EJBException
createTimer
public javax.ejb.Timer createTimer(Object primaryKey,
Method timeoutMethod,
Date expiration,
javax.ejb.TimerConfig timerConfig)
throws IllegalArgumentException,
IllegalStateException,
javax.ejb.EJBException
- Specified by:
createTimer in interface EjbTimerService
- Throws:
IllegalArgumentException
IllegalStateException
javax.ejb.EJBException
createTimer
public javax.ejb.Timer createTimer(Object primaryKey,
Method timeoutMethod,
Date initialExpiration,
long intervalDuration,
javax.ejb.TimerConfig timerConfig)
throws IllegalArgumentException,
IllegalStateException,
javax.ejb.EJBException
- Specified by:
createTimer in interface EjbTimerService
- Throws:
IllegalArgumentException
IllegalStateException
javax.ejb.EJBException
createTimer
public javax.ejb.Timer createTimer(Object primaryKey,
Method timeoutMethod,
javax.ejb.ScheduleExpression scheduleExpression,
javax.ejb.TimerConfig timerConfig)
- Specified by:
createTimer in interface EjbTimerService
getTimerStore
public TimerStore getTimerStore()
getScheduler
public org.quartz.Scheduler getScheduler()
ejbTimeout
public void ejbTimeout(TimerData timerData)
- This method calls the ejbTimeout method and starts a transaction if the timeout is transacted.
This method will retry failed ejbTimeout calls until retryAttempts is exceeded.
- Parameters:
timerData - the timer to call.
Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.