org.apache.avalon.excalibur.thread
Interface ThreadControl


public interface ThreadControl

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

Author:
Peter Donald

Method Summary
 java.lang.Throwable getThrowable()
          Retrieve throwable that caused thread to cease execution.
 void interupt()
          Call Thread.interupt() 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 java.lang.IllegalStateException,
                 java.lang.InterruptedException
Wait for specified time for thread to complete it's work.
Parameters:
milliSeconds - the duration in milliseconds to wait until the thread has finished work
Throws:
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.

interupt

public void interupt()
              throws java.lang.IllegalStateException,
                     java.lang.SecurityException
Call Thread.interupt() on thread being controlled.
Throws:
java.lang.IllegalStateException - if isValid() == false
java.lang.SecurityException - if caller does not have permission to call interupt()

isFinished

public boolean isFinished()
Determine if thread has finished execution
Returns:
true if thread is finished, false otherwise

getThrowable

public java.lang.Throwable getThrowable()
Retrieve throwable that caused thread to cease execution. Only valid when true == isFinished()
Returns:
the throwable that caused thread to finish execution


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.