FileDocCategorySizeDatePackage
Timer.javaAPI DocGlassfish v2 API6015Fri May 04 22:35:54 BST 2007javax.ejb

Timer

public interface Timer
The Timer interface contains information about a timer that was created through the EJB Timer Service.

Fields Summary
Constructors Summary
Methods Summary
public voidcancel()
Cause the timer and all its associated expiration notifications to be cancelled.

exception
java.lang.IllegalStateException If this method is invoked while the instance is in a state that does not allow access to this method.
exception
javax.ejb.NoSuchObjectLocalException If invoked on a timer that has expired or has been cancelled.
exception
javax.ejb.EJBException If this method could not complete due to a system-level failure.

public TimerHandlegetHandle()
Get a serializable handle to the timer. This handle can be used at a later time to re-obtain the timer reference.

return
a serializable handle to the timer.
exception
java.lang.IllegalStateException If this method is invoked while the instance is in a state that does not allow access to this method.
exception
javax.ejb.NoSuchObjectLocalException If invoked on a timer that has expired or has been cancelled.
exception
javax.ejb.EJBException If this method could not complete due to a system-level failure.

public java.io.SerializablegetInfo()
Get the information associated with the timer at the time of creation.

return
The Serializable object that was passed in at timer creation, or null if the info argument passed in at timer creation was null.
exception
java.lang.IllegalStateException If this method is invoked while the instance is in a state that does not allow access to this method.
exception
javax.ejb.NoSuchObjectLocalException If invoked on a timer that has expired or has been cancelled.
exception
javax.ejb.EJBException If this method could not complete due to a system-level failure.

public java.util.DategetNextTimeout()
Get the point in time at which the next timer expiration is scheduled to occur.

return
the point in time at which the next timer expiration is scheduled to occur.
exception
java.lang.IllegalStateException If this method is invoked while the instance is in a state that does not allow access to this method.
exception
javax.ejb.NoSuchObjectLocalException If invoked on a timer that has expired or has been cancelled.
exception
javax.ejb.EJBException If this method could not complete due to a system-level failure.

public longgetTimeRemaining()
Get the number of milliseconds that will elapse before the next scheduled timer expiration.

return
the number of milliseconds that will elapse before the next scheduled timer expiration.
exception
java.lang.IllegalStateException If this method is invoked while the instance is in a state that does not allow access to this method.
exception
javax.ejb.NoSuchObjectLocalException If invoked on a timer that has expired or has been cancelled.
exception
javax.ejb.EJBException If this method could not complete due to a system-level failure.