|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.bm.utils.substitues.TimerMock
public class TimerMock
Author: Marcus Nilsson Date: May 16, 2007 Time: 9:52:08 AM
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
TimerMock(long timeout,
java.io.Serializable info)
Constructor. |
Method Summary | |
---|---|
void |
cancel()
Cause the timer and all its associated expiration notifications to be cancelled. |
TimerHandle |
getHandle()
Get a serializable handle to the timer. |
java.io.Serializable |
getInfo()
Get the information associated with the timer at the time of creation. |
java.util.Date |
getNextTimeout()
Get the point in time at which the next timer expiration is scheduled to occur. |
long |
getTimeRemaining()
Get the number of milliseconds that will elapse before the next scheduled timer expiration. |
void |
run()
|
void |
timerExpired()
|
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TimerMock(long timeout, java.io.Serializable info)
timeout
- timeoutinfo
- the info object.Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void timerExpired()
public void cancel() throws java.lang.IllegalStateException, NoSuchObjectLocalException, EJBException
cancel
in interface Timer
java.lang.IllegalStateException
- If this method is invoked while 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 java.lang.IllegalStateException, NoSuchObjectLocalException, EJBException
getTimeRemaining
in interface Timer
java.lang.IllegalStateException
- If this method is invoked while 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 java.util.Date getNextTimeout() throws java.lang.IllegalStateException, NoSuchObjectLocalException, EJBException
getNextTimeout
in interface Timer
java.lang.IllegalStateException
- If this method is invoked while 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 java.io.Serializable getInfo() throws java.lang.IllegalStateException, NoSuchObjectLocalException, EJBException
getInfo
in interface Timer
java.lang.IllegalStateException
- If this method is invoked while 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 java.lang.IllegalStateException, NoSuchObjectLocalException, EJBException
getHandle
in interface Timer
java.lang.IllegalStateException
- If this method is invoked while 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |