|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.excalibur.thread.impl.DefaultThreadControl
final class DefaultThreadControl
Default implementation of ThreadControl interface. Is used by worker thread to supply control information to the clients of thread pool.
Field Summary | |
---|---|
private java.lang.Thread |
m_thread
|
private java.lang.Throwable |
m_throwable
|
Constructor Summary | |
---|---|
protected |
DefaultThreadControl(java.lang.Thread thread)
Construct thread control for a specific thread. |
Method Summary | |
---|---|
protected void |
finish(java.lang.Throwable throwable)
Method called by thread to release control. |
java.lang.Throwable |
getThrowable()
Retrieve throwable that caused thread to cease execution. |
void |
interrupt()
Call Thread.interrupt() on thread being controlled. |
void |
interupt()
|
boolean |
isFinished()
Determine if thread has finished execution |
void |
join(long milliSeconds)
Wait for specified time for thread to complete it's work. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.Thread m_thread
private java.lang.Throwable m_throwable
Constructor Detail |
---|
protected DefaultThreadControl(java.lang.Thread thread)
thread
- the thread to controlMethod Detail |
---|
public void join(long milliSeconds) throws java.lang.IllegalStateException, java.lang.InterruptedException
join
in interface org.apache.excalibur.thread.ThreadControl
milliSeconds
- the duration in milliseconds to wait until the thread has finished work
java.lang.IllegalStateException
- if isValid() == false
java.lang.InterruptedException
- if another thread has interrupted the current thread.
The interrupted status of the current thread is cleared when this exception
is thrown.public void interupt() throws java.lang.IllegalStateException, java.lang.SecurityException
java.lang.IllegalStateException
java.lang.SecurityException
public void interrupt() throws java.lang.IllegalStateException, java.lang.SecurityException
interrupt
in interface org.apache.excalibur.thread.ThreadControl
java.lang.IllegalStateException
- if isValid() == false
java.lang.SecurityException
- if caller does not have permission to call interupt()public boolean isFinished()
isFinished
in interface org.apache.excalibur.thread.ThreadControl
public java.lang.Throwable getThrowable()
getThrowable
in interface org.apache.excalibur.thread.ThreadControl
protected void finish(java.lang.Throwable throwable)
throwable
- Throwable that caused thread to complete (may be null)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |