org.apache.openejb.core.timer
Class EjbTimerServiceImpl

java.lang.Object
  extended by org.apache.openejb.core.timer.EjbTimerServiceImpl
All Implemented Interfaces:
EjbTimerService

public class EjbTimerServiceImpl
extends Object
implements EjbTimerService


Constructor Summary
EjbTimerServiceImpl(DeploymentInfo deployment)
           
EjbTimerServiceImpl(DeploymentInfo deployment, TransactionManager transactionManager, Executor threadPool, TimerStore timerStore, int retryAttempts)
           
 
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, Date initialExpiration, long intervalDuration, Serializable info)
           
 javax.ejb.Timer createTimer(Object primaryKey, Date expiration, Serializable info)
           
 javax.ejb.Timer createTimer(Object primaryKey, long initialDuration, long intervalDuration, Serializable info)
           
 javax.ejb.Timer createTimer(Object primaryKey, long duration, Serializable info)
           
static Executor getDefaultExecutor()
           
static TransactionManager getDefaultTransactionManager()
           
 javax.ejb.Timer getTimer(long timerId)
           
 Collection<javax.ejb.Timer> getTimers(Object primaryKey)
           
 TransactionManager getTransactionManager()
           
 void schedule(TimerData timerData)
          Called from TimerData and start when a timer should be scheduled with the java.util.Timer.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EjbTimerServiceImpl

public EjbTimerServiceImpl(DeploymentInfo deployment)

EjbTimerServiceImpl

public EjbTimerServiceImpl(DeploymentInfo deployment,
                           TransactionManager transactionManager,
                           Executor threadPool,
                           TimerStore timerStore,
                           int retryAttempts)
Method Detail

getDefaultExecutor

public static Executor getDefaultExecutor()

getDefaultTransactionManager

public static TransactionManager getDefaultTransactionManager()

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,
                                   long duration,
                                   Serializable info)
                            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,
                                   long initialDuration,
                                   long intervalDuration,
                                   Serializable info)
                            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,
                                   Date expiration,
                                   Serializable info)
                            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,
                                   Date initialExpiration,
                                   long intervalDuration,
                                   Serializable info)
                            throws IllegalArgumentException,
                                   IllegalStateException,
                                   javax.ejb.EJBException
Specified by:
createTimer in interface EjbTimerService
Throws:
IllegalArgumentException
IllegalStateException
javax.ejb.EJBException


Copyright © 1999-2013 The Apache OpenEJB development community. All Rights Reserved.