Node Director
Public Member Functions | List of all members
sfi.director.util.TimeoutThread Class Reference

Implements timeout. More...

Inheritance diagram for sfi.director.util.TimeoutThread:
sfi.director.util.StoppableThread sfi.director.util.DirectorThread

Public Member Functions

 TimeoutThread ()
 TimeoutThread (long timeout)
 Setup and start timeout thread with the given timeout for the current thread.
void work ()
void setParent (Thread master)
 Set parent thread.
void setTimeout (long timeout)
 Set timeout in milliseconds.
- Public Member Functions inherited from sfi.director.util.StoppableThread
synchronized void stopGracefully ()
void interrupt ()
void clearInterrupt ()
- Public Member Functions inherited from sfi.director.util.DirectorThread
 DirectorThread ()
final void run ()

Additional Inherited Members

- Public Attributes inherited from sfi.director.util.StoppableThread
boolean keeprunning = true
Exception stack
- Protected Member Functions inherited from sfi.director.util.DirectorThread
void finalize () throws Throwable

Detailed Description

Implements timeout.

Once started, the timeout thread waits the configured amount of time and then interrupts the parent thread. If the TimeoutThread is interrupted before the timeout is over the parent thread is not going to be interrupted.

Constructor & Destructor Documentation

sfi.director.util.TimeoutThread.TimeoutThread ( )
sfi.director.util.TimeoutThread.TimeoutThread ( long  timeout)

Setup and start timeout thread with the given timeout for the current thread.

Note
This is special. The thread is not only created but also immediately started.

References sfi.director.util.TimeoutThread.setTimeout().

Member Function Documentation

void sfi.director.util.TimeoutThread.setParent ( Thread  master)

Set parent thread.

The object is created with the parent being the current thread. So, usually it is unnecessary to explicitly setParent().

Referenced by sfi.director.util.TimeoutThread.TimeoutThread().

void sfi.director.util.TimeoutThread.setTimeout ( long  timeout)

Set timeout in milliseconds.

Referenced by sfi.director.util.TimeoutThread.TimeoutThread().

void sfi.director.util.TimeoutThread.work ( )

Reimplemented from sfi.director.util.DirectorThread.


The documentation for this class was generated from the following file: