bloritsch 2003/03/04 06:34:39
Modified: thread/src/java/org/apache/avalon/excalibur/thread
ThreadControl.java ThreadPool.java
thread/src/java/org/apache/avalon/excalibur/thread/impl
BasicThreadPool.java DefaultThreadPool.java
ResourceLimitingThreadPool.java
thread/src/java/org/apache/excalibur/thread
ThreadControl.java
Log:
make the old Thread completely compatible with the new
Revision Changes Path
1.9 +1 -36
avalon-excalibur/thread/src/java/org/apache/avalon/excalibur/thread/ThreadControl.java
Index: ThreadControl.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/thread/src/java/org/apache/avalon/excalibur/thread/ThreadControl.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ThreadControl.java 7 Feb 2003 16:08:55 -0000 1.8
+++ ThreadControl.java 4 Mar 2003 14:34:38 -0000 1.9
@@ -58,41 +58,6 @@
* @deprecated Replaced with org.apache.excalibur.thread.ThreadControl
*/
public interface ThreadControl
+ extends org.apache.excalibur.thread.ThreadControl
{
- /**
- * Wait for specified time for thread to complete it's work.
- *
- * @param milliSeconds the duration in milliseconds to wait until the thread
has finished work
- * @throws IllegalStateException if isValid() == false
- * @throws InterruptedException if another thread has interrupted the current
thread.
- * The interrupted status of the current thread is cleared when this
exception
- * is thrown.
- */
- void join( long milliSeconds )
- throws IllegalStateException, InterruptedException;
-
- /**
- * Call Thread.interupt() on thread being controlled.
- *
- * @throws IllegalStateException if isValid() == false
- * @throws SecurityException if caller does not have permission to call
interupt()
- * @deprecated Mispelled method. Please use interrupt() instead
- */
- void interupt()
- throws IllegalStateException, SecurityException;
-
- /**
- * Determine if thread has finished execution
- *
- * @return true if thread is finished, false otherwise
- */
- boolean isFinished();
-
- /**
- * Retrieve throwable that caused thread to cease execution.
- * Only valid when true == isFinished()
- *
- * @return the throwable that caused thread to finish execution
- */
- Throwable getThrowable();
}
1.7 +0 -1
avalon-excalibur/thread/src/java/org/apache/avalon/excalibur/thread/ThreadPool.java
Index: ThreadPool.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/thread/src/java/org/apache/avalon/excalibur/thread/ThreadPool.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ThreadPool.java 7 Feb 2003 16:08:55 -0000 1.6
+++ ThreadPool.java 4 Mar 2003 14:34:38 -0000 1.7
@@ -51,7 +51,6 @@
package org.apache.avalon.excalibur.thread;
import org.apache.avalon.framework.activity.Executable;
-import org.apache.excalibur.thread.ThreadControl;
/**
* This class is the public frontend for the thread pool code.
1.8 +4 -2
avalon-excalibur/thread/src/java/org/apache/avalon/excalibur/thread/impl/BasicThreadPool.java
Index: BasicThreadPool.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/thread/src/java/org/apache/avalon/excalibur/thread/impl/BasicThreadPool.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- BasicThreadPool.java 7 Feb 2003 16:08:55 -0000 1.7
+++ BasicThreadPool.java 4 Mar 2003 14:34:38 -0000 1.8
@@ -53,12 +53,12 @@
import org.apache.avalon.excalibur.pool.ObjectFactory;
import org.apache.avalon.excalibur.pool.Pool;
import org.apache.avalon.excalibur.thread.ThreadPool;
+import org.apache.avalon.excalibur.thread.ThreadControl;
import org.apache.avalon.framework.activity.Disposable;
import org.apache.avalon.framework.activity.Executable;
import org.apache.avalon.framework.container.ContainerUtil;
import org.apache.avalon.framework.logger.LogEnabled;
import org.apache.avalon.framework.logger.Logger;
-import org.apache.excalibur.thread.ThreadControl;
import org.apache.excalibur.thread.impl.AbstractThreadPool;
import org.apache.excalibur.thread.impl.WorkerThread;
import org.apache.excalibur.threadcontext.ThreadContext;
@@ -192,7 +192,9 @@
*/
public ThreadControl execute( final Executable work )
{
- return execute( new ExecutableExecuteable( work ) );
+ return
+ new WrappedThreadControl(
+ execute( new ExecutableExecuteable( work ) ) );
}
/**
1.16 +5 -4
avalon-excalibur/thread/src/java/org/apache/avalon/excalibur/thread/impl/DefaultThreadPool.java
Index: DefaultThreadPool.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/thread/src/java/org/apache/avalon/excalibur/thread/impl/DefaultThreadPool.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- DefaultThreadPool.java 7 Feb 2003 16:08:55 -0000 1.15
+++ DefaultThreadPool.java 4 Mar 2003 14:34:38 -0000 1.16
@@ -53,6 +53,7 @@
import org.apache.avalon.excalibur.pool.ObjectFactory;
import org.apache.avalon.excalibur.pool.SoftResourceLimitingPool;
import org.apache.avalon.excalibur.thread.ThreadPool;
+import org.apache.avalon.excalibur.thread.ThreadControl;
import org.apache.avalon.framework.activity.Disposable;
import org.apache.avalon.framework.activity.Executable;
import org.apache.avalon.framework.container.ContainerUtil;
@@ -60,7 +61,6 @@
import org.apache.avalon.framework.logger.LogKitLogger;
import org.apache.avalon.framework.logger.Loggable;
import org.apache.avalon.framework.logger.Logger;
-import org.apache.excalibur.thread.ThreadControl;
import org.apache.excalibur.threadcontext.ThreadContext;
/**
@@ -148,7 +148,8 @@
*/
public ThreadControl execute( final Executable work )
{
- return m_pool.execute( work );
+ return new WrappedThreadControl(
+ m_pool.execute( new ExecutableExecuteable( work ) ) );
}
/**
@@ -158,7 +159,7 @@
* @param work the work to be executed.
* @return the ThreadControl
*/
- public ThreadControl execute( final Runnable work )
+ public org.apache.excalibur.thread.ThreadControl execute( final Runnable work )
{
return m_pool.execute( work );
}
@@ -170,7 +171,7 @@
* @param work the work to be executed.
* @return the ThreadControl
*/
- public ThreadControl execute( final org.apache.excalibur.thread.Executable work
)
+ public org.apache.excalibur.thread.ThreadControl execute( final
org.apache.excalibur.thread.Executable work )
{
return m_pool.execute( work );
}
1.13 +3 -3
avalon-excalibur/thread/src/java/org/apache/avalon/excalibur/thread/impl/ResourceLimitingThreadPool.java
Index: ResourceLimitingThreadPool.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/thread/src/java/org/apache/avalon/excalibur/thread/impl/ResourceLimitingThreadPool.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ResourceLimitingThreadPool.java 7 Feb 2003 16:08:55 -0000 1.12
+++ ResourceLimitingThreadPool.java 4 Mar 2003 14:34:38 -0000 1.13
@@ -289,9 +289,9 @@
* @param work the work to be executed.
* @return the ThreadControl
*/
- public ThreadControl execute( final Executable work )
+ public org.apache.avalon.excalibur.thread.ThreadControl execute( final
Executable work )
{
- return m_pool.execute( work );
+ return new WrappedThreadControl( m_pool.execute( work ) );
}
/**
1.6 +0 -1
avalon-excalibur/thread/src/java/org/apache/excalibur/thread/ThreadControl.java
Index: ThreadControl.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/thread/src/java/org/apache/excalibur/thread/ThreadControl.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ThreadControl.java 7 Feb 2003 16:08:55 -0000 1.5
+++ ThreadControl.java 4 Mar 2003 14:34:39 -0000 1.6
@@ -57,7 +57,6 @@
* @author <a href="mailto:peter at apache.org">Peter Donald</a>
*/
public interface ThreadControl
- extends org.apache.avalon.excalibur.thread.ThreadControl
{
/**
* Wait for specified time for thread to complete it's work.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]