org.apache.excalibur.thread
Interface ThreadControl

All Superinterfaces:
ThreadControl

public interface ThreadControl
extends ThreadControl

This interface defines the method through which Threads can be controller.

Author:
Avalon Development Team, Peter Donald

Method Summary
 Throwable getThrowable()
          Retrieve throwable that caused thread to cease execution.
 void interrupt()
          Call Thread.interrupt() on thread being controlled.
 boolean isFinished()
          Determine if thread has finished execution
 void join(long milliSeconds)
          Wait for specified time for thread to complete it's work.
 

Method Detail

join

public void join(long milliSeconds)
          throws IllegalStateException,
                 InterruptedException
Wait for specified time for thread to complete it's work.

Specified by:
join in interface ThreadControl
Parameters:
milliSeconds - the duration in milliseconds to wait until the thread has finished work
Throws:
IllegalStateException - if isValid() == false
InterruptedException - if another thread has interrupted the current thread. The interrupted status of the current thread is cleared when this exception is thrown.

interrupt

public void interrupt()
               throws IllegalStateException,
                      SecurityException
Call Thread.interrupt() on thread being controlled.

Specified by:
interrupt in interface ThreadControl
Throws:
IllegalStateException - if isValid() == false
SecurityException - if caller does not have permission to call interupt()

isFinished

public boolean isFinished()
Determine if thread has finished execution

Specified by:
isFinished in interface ThreadControl
Returns:
true if thread is finished, false otherwise

getThrowable

public Throwable getThrowable()
Retrieve throwable that caused thread to cease execution. Only valid when true == isFinished()

Specified by:
getThrowable in interface ThreadControl
Returns:
the throwable that caused thread to finish execution


Copyright © 2000-2003 Apache Jakarta Project. All Rights Reserved.