|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ow2.jonas.lib.ejb21.JTimerService
public class JTimerService
JOnAS Implementation of the TimerService interface (from EJB 2.1) One such object is created the first time a bean calls getTimerService. Basically manages the list of the Timers for that bean.
Constructor Summary | |
---|---|
JTimerService(JEntitySwitch es)
constructor used for Entity beans |
|
JTimerService(JFactory bf)
constructor used for MDB or Session beans |
Method Summary | |
---|---|
void |
cancelAllTimers()
cancel all timers (when entity bean is removed) |
Timer |
createTimer(Date initialExpiration,
long intervalDuration,
Serializable info)
Create an interval timer whose first expiration occurs at a given point in time and whose subsequent expirations occur after a specified interval. |
Timer |
createTimer(Date expiration,
Serializable info)
Create a single-action timer that expires at a given point in time. |
Timer |
createTimer(long initialDuration,
long intervalDuration,
Serializable info)
Create an interval timer whose first expiration occurs after a specified duration, and whose subsequent expirations occur after a specified interval. |
Timer |
createTimer(long duration,
Serializable info)
Create a single-action timer that expires after a specified duration. |
String |
getContainer()
|
String |
getEjbName()
|
Serializable |
getPK()
|
Timer |
getTimerByTime(long initialDuration,
long intervalDuration,
Serializable info)
get a Timer from the list |
Collection |
getTimers()
Get all the active timers associated with this bean. |
TransactionManager |
getTransactionManager()
|
void |
notify(Timer timer)
Notify the timer to the listener |
void |
remove(Timer timer)
Remove the Timer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JTimerService(JFactory bf)
public JTimerService(JEntitySwitch es)
Method Detail |
---|
public TransactionManager getTransactionManager()
public void notify(Timer timer)
timer
- The Timer object that will be notifiedpublic void remove(Timer timer)
timer
- The Timer object that will be removedpublic void cancelAllTimers()
public Timer getTimerByTime(long initialDuration, long intervalDuration, Serializable info)
public Timer createTimer(Date initialExpiration, long intervalDuration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException
createTimer
in interface TimerService
initialExpiration
- The point in time at which the first timer
expiration must occur.intervalDuration
- The number of milliseconds that must elapse
between timer expiration notifications.info
- Application information to be delivered along with the timer
expiration. This can be null.
IllegalArgumentException
- initialExpiration = 0, or
intervalDuration < 0 or initialExpiration.getTime() < 0.
IllegalStateException
- the instance is in a state that does not
allow access to this method.
EJBException
- If this method could not complete due to a
system-level failure.public Timer createTimer(Date expiration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException
createTimer
in interface TimerService
expiration
- The point in time at which the timer expiration must
occur.info
- Application information to be delivered along with the timer
expiration. This can be null.
IllegalArgumentException
- expiration = 0, or expiration.getTime() <
0.
IllegalStateException
- the instance is in a state that does not
allow access to this method.
EJBException
- If this method could not complete due to a
system-level failure.public Timer createTimer(long initialDuration, long intervalDuration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException
createTimer
in interface TimerService
initialDuration
- The number of milliseconds that must elapse before
the first timer expiration notification.intervalDuration
- The number of milliseconds that must elapse
between timer expiration notifications.info
- Application information to be delivered along with the timer
expiration. This can be null.
IllegalArgumentException
- initialExpiration = 0, or
intervalDuration < 0.
IllegalStateException
- the instance is in a state that does not
allow access to this method.
EJBException
- If this method could not complete due to a
system-level failure.public Timer createTimer(long duration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException
createTimer
in interface TimerService
duration
- The number of milliseconds that must elapse before the
timer expires.info
- Application information to be delivered along with the timer
expiration. This can be null.
IllegalArgumentException
- initialExpiration = 0, or
intervalDuration < 0.
IllegalStateException
- the instance is in a state that does not
allow access to this method.
EJBException
- If this method could not complete due to a
system-level failure.public Collection getTimers() throws IllegalStateException, EJBException
getTimers
in interface TimerService
IllegalStateException
- the instance is in a state that does not
allow access to this method.
EJBException
- If this method could not complete due to a
system-level failure.public String getEjbName()
public Serializable getPK()
public String getContainer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |