|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.simpleframework.util.thread.Daemon
public abstract class Daemon
The Daemon object provides a named daemon thread
which will execute the run method when started.
This offers some convenience in that it hides the normal thread
methods and also allows the object extending this to provide
the name of the internal thread, which is given an incrementing
sequence number appended to the name provided.
| Constructor Summary | |
|---|---|
protected |
Daemon()
Constructor for the Daemon object. |
| Method Summary | |
|---|---|
void |
interrupt()
This is used to interrupt the internal thread. |
void |
join()
This is used to join with the internal thread of this daemon. |
void |
start()
This is used to start the internal thread. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.lang.Runnable |
|---|
run |
| Constructor Detail |
|---|
protected Daemon()
Daemon object. This will
create the internal thread and ensure it is a daemon. When it
is started the name of the internal thread is set using the
name of the instance as taken from getName. If
the name provided is null then no name is set for the thread.
| Method Detail |
|---|
public void start()
run method of
this instance. Aside from starting the thread this will also
ensure the internal thread has a unique name.
public void interrupt()
public void join()
throws InterruptedException
join
method is provided. This allows asynchronous threads to wait
for the daemon to complete simulating synchronous action.
InterruptedException - if the thread is interrupted
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||