Constructor and Description |
---|
LifeCycleThread() |
Modifier and Type | Method and Description |
---|---|
boolean |
error(Error e)
Handle error from loop.
|
boolean |
exception(Exception e)
Handle exception from loop.
|
Thread |
getThread() |
boolean |
isDaemon() |
boolean |
isStarted() |
abstract void |
loop() |
void |
run() |
void |
setDaemon(boolean d) |
void |
start()
Start the LifeCycle.
|
void |
stop()
Stop the LifeCycle.
|
public boolean isDaemon()
public void setDaemon(boolean d)
public Thread getThread()
public boolean isStarted()
public void start() throws Exception
LifeCycle
public void stop() throws InterruptedException
LifeCycle
stop
in interface LifeCycle
InterruptedException
- Stopping a lifecycle is rarely atomic
and may be interrupted by another thread. If this happens
InterruptedException is throw and the component will be in an
indeterminant state and should probably be discarded.public boolean exception(Exception e)
e
- The exceptionpublic boolean error(Error e)
e
- The exceptionpublic abstract void loop() throws InterruptedException, InterruptedIOException, Exception
Copyright © 2016. All Rights Reserved.