|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.jonas.lib.ejb21.JTimer
public class JTimer
JOnAS Implementation of the Timer interface (from EJB 2.1) This is a basic implementation based on jonas_timer. A later (and better ?) implementation could be based on Quartz.
| Constructor Summary | |
|---|---|
JTimer(JTimerService timerservice,
long initial,
long period,
Serializable info)
constructor |
|
| Method Summary | |
|---|---|
void |
afterCompletion(int status)
The afterCompletion method is called by the transaction manager after the transaction is committed or rolled back. |
void |
beforeCompletion()
|
void |
cancel()
Cause the timer and all its associated expiration notifications to be cancelled. |
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one. |
TimerHandle |
getHandle()
Get a serializable handle to the timer. |
Serializable |
getInfo()
Get the information associated with the timer at the time of creation. |
long |
getInitialDuration()
|
Date |
getNextTimeout()
Get the point in time at which the next timer expiration is scheduled to occur. |
long |
getPeriod()
|
long |
getStartTime()
|
long |
getTimeRemaining()
Get the number of milliseconds that will elapse before the next scheduled timer expiration. |
JTimerService |
getTimerService()
|
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isCancelled()
|
boolean |
sameas(Object obj)
This is used to retrieve a Timer from its Handle only. |
void |
setFile(File file)
Set the file associated with this timer. |
void |
startTimer()
start the Timer |
void |
stopTimer()
Stop a timer. |
void |
timeoutExpired(Object arg)
The timer has just expired. |
String |
toString()
Give a String representation of the Timer |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JTimer(JTimerService timerservice,
long initial,
long period,
Serializable info)
| Method Detail |
|---|
public String toString()
toString in class Objectpublic void setFile(File file)
public long getStartTime()
public long getInitialDuration()
public long getPeriod()
public JTimerService getTimerService()
public void startTimer()
public void stopTimer()
public boolean isCancelled()
public boolean equals(Object obj)
equals in class Objectobj - - the reference object with which to compare.
public int hashCode()
hashCode in class Objectpublic boolean sameas(Object obj)
public void timeoutExpired(Object arg)
timeoutExpired in interface TimerEventListener
public void cancel()
throws IllegalStateException,
NoSuchObjectLocalException,
EJBException
cancel in interface TimerIllegalStateException - the instance is in a state that does not
allow access to this method.
NoSuchObjectLocalException - If invoked on a timer that has expired
or has been cancelled.
EJBException - If this method could not complete due to a
system-level failure.
public long getTimeRemaining()
throws IllegalStateException,
NoSuchObjectLocalException,
EJBException
getTimeRemaining in interface TimerIllegalStateException - the instance is in a state that does not
allow access to this method.
NoSuchObjectLocalException - If invoked on a timer that has expired
or has been cancelled.
EJBException - If this method could not complete due to a
system-level failure.
public Date getNextTimeout()
throws IllegalStateException,
NoSuchObjectLocalException,
EJBException
getNextTimeout in interface TimerIllegalStateException - the instance is in a state that does not
allow access to this method.
NoSuchObjectLocalException - If invoked on a timer that has expired
or has been cancelled.
EJBException - If this method could not complete due to a
system-level failure.
public Serializable getInfo()
throws IllegalStateException,
NoSuchObjectLocalException,
EJBException
getInfo in interface TimerIllegalStateException - the instance is in a state that does not
allow access to this method.
NoSuchObjectLocalException - If invoked on a timer that has expired
or has been cancelled.
EJBException - If this method could not complete due to a
system-level failure.
public TimerHandle getHandle()
throws IllegalStateException,
NoSuchObjectLocalException,
EJBException
getHandle in interface TimerIllegalStateException - the instance is in a state that does not
allow access to this method.
NoSuchObjectLocalException - If invoked on a timer that has expired
or has been cancelled.
EJBException - If this method could not complete due to a
system-level failure.public void afterCompletion(int status)
afterCompletion in interface Synchronizationstatus - The status of the transaction completion.public void beforeCompletion()
beforeCompletion in interface Synchronization
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||