avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: avalon-excalibur/thread/src/java/org/apache/excalibur/thread ThreadControl.java
Date Sun, 23 Mar 2003 03:00:44 GMT
bloritsch    2003/03/22 19:00:44

  Modified:    fortress/src/java/org/apache/avalon/fortress/impl/role
                        ServiceRoleManager.java
               fortress/src/java/org/apache/avalon/fortress/util
                        Service.java
               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:
  revert the changes to thread--to provide binary compatibility
  
  Revision  Changes    Path
  1.3       +49 -54    avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/role/ServiceRoleManager.java
  
  Index: ServiceRoleManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/role/ServiceRoleManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServiceRoleManager.java	19 Mar 2003 12:55:48 -0000	1.2
  +++ ServiceRoleManager.java	23 Mar 2003 03:00:44 -0000	1.3
  @@ -1,57 +1,52 @@
  -/* ====================================================================
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 2003 The Apache Software Foundation. All rights
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer.
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  - *
  - * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:
  - *    "This product includes software developed by the
  - *    Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software
  - *    itself, if and wherever such third-party acknowledgments
  - *    normally appear.
  - *
  - * 4. The names "D-Haven" and "Apache Software Foundation"
  - *    must not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written
  - *    permission, please contact apache@apache.org.
  - *
  - * 5. Products derived from this software may not be called "Apache",
  - *    nor may "Apache" appear in their name, without prior written
  - *    permission of the Apache Software Foundation.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation. For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  - */
  +/*
  +
  + ============================================================================
  +                   The Apache Software License, Version 1.1
  + ============================================================================
  +
  + Copyright (C) @year@ The Apache Software Foundation. All rights reserved.
  +
  + Redistribution and use in source and binary forms, with or without modifica-
  + tion, are permitted provided that the following conditions are met:
  +
  + 1. Redistributions of  source code must  retain the above copyright  notice,
  +    this list of conditions and the following disclaimer.
  +
  + 2. Redistributions in binary form must reproduce the above copyright notice,
  +    this list of conditions and the following disclaimer in the documentation
  +    and/or other materials provided with the distribution.
  +
  + 3. The end-user documentation included with the redistribution, if any, must
  +    include  the following  acknowledgment:  "This product includes  software
  +    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  +    Alternately, this  acknowledgment may  appear in the software itself,  if
  +    and wherever such third-party acknowledgments normally appear.
  +
  + 4. The names "Jakarta", "Avalon", "Excalibur" and "Apache Software Foundation"
  +    must not be used to endorse or promote products derived from this  software
  +    without  prior written permission. For written permission, please contact
  +    apache@apache.org.
  +
  + 5. Products  derived from this software may not  be called "Apache", nor may
  +    "Apache" appear  in their name,  without prior written permission  of the
  +    Apache Software Foundation.
  +
  + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  + APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  + INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  + DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  + ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  + (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  +
  + This software  consists of voluntary contributions made  by many individuals
  + on  behalf of the Apache Software  Foundation. For more  information on the
  + Apache Software Foundation, please see <http://www.apache.org/>.
  +
  +*/
   package org.apache.avalon.fortress.impl.role;
   
   import java.io.BufferedReader;
  
  
  
  1.4       +49 -54    avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/util/Service.java
  
  Index: Service.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/util/Service.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Service.java	19 Mar 2003 12:55:48 -0000	1.3
  +++ Service.java	23 Mar 2003 03:00:44 -0000	1.4
  @@ -1,57 +1,52 @@
  -/* ====================================================================
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 2003 The Apache Software Foundation. All rights
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer.
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  - *
  - * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:
  - *    "This product includes software developed by the
  - *    Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software
  - *    itself, if and wherever such third-party acknowledgments
  - *    normally appear.
  - *
  - * 4. The names "D-Haven" and "Apache Software Foundation"
  - *    must not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written
  - *    permission, please contact apache@apache.org.
  - *
  - * 5. Products derived from this software may not be called "Apache",
  - *    nor may "Apache" appear in their name, without prior written
  - *    permission of the Apache Software Foundation.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation. For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  - */
  +/*
  +
  + ============================================================================
  +                   The Apache Software License, Version 1.1
  + ============================================================================
  +
  + Copyright (C) @year@ The Apache Software Foundation. All rights reserved.
  +
  + Redistribution and use in source and binary forms, with or without modifica-
  + tion, are permitted provided that the following conditions are met:
  +
  + 1. Redistributions of  source code must  retain the above copyright  notice,
  +    this list of conditions and the following disclaimer.
  +
  + 2. Redistributions in binary form must reproduce the above copyright notice,
  +    this list of conditions and the following disclaimer in the documentation
  +    and/or other materials provided with the distribution.
  +
  + 3. The end-user documentation included with the redistribution, if any, must
  +    include  the following  acknowledgment:  "This product includes  software
  +    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  +    Alternately, this  acknowledgment may  appear in the software itself,  if
  +    and wherever such third-party acknowledgments normally appear.
  +
  + 4. The names "Jakarta", "Avalon", "Excalibur" and "Apache Software Foundation"
  +    must not be used to endorse or promote products derived from this  software
  +    without  prior written permission. For written permission, please contact
  +    apache@apache.org.
  +
  + 5. Products  derived from this software may not  be called "Apache", nor may
  +    "Apache" appear  in their name,  without prior written permission  of the
  +    Apache Software Foundation.
  +
  + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  + APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  + INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  + DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  + ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  + (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  +
  + This software  consists of voluntary contributions made  by many individuals
  + on  behalf of the Apache Software  Foundation. For more  information on the
  + Apache Software Foundation, please see <http://www.apache.org/>.
  +
  +*/
   package org.apache.avalon.fortress.util;
   
   import java.io.BufferedReader;
  
  
  
  1.10      +35 -1     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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ThreadControl.java	4 Mar 2003 14:34:38 -0000	1.9
  +++ ThreadControl.java	23 Mar 2003 03:00:44 -0000	1.10
  @@ -58,6 +58,40 @@
    * @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 {@link Thread#interrupt()} on thread being controlled.
  +     *
  +     * @throws IllegalStateException if isValid() == false
  +     * @throws SecurityException if caller does not have permission to call interupt()
  +     */
  +    void interrupt()
  +        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.8       +1 -0      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ThreadPool.java	4 Mar 2003 14:34:38 -0000	1.7
  +++ ThreadPool.java	23 Mar 2003 03:00:44 -0000	1.8
  @@ -51,6 +51,7 @@
   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.10      +2 -4      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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- BasicThreadPool.java	13 Mar 2003 05:48:11 -0000	1.9
  +++ BasicThreadPool.java	23 Mar 2003 03:00:44 -0000	1.10
  @@ -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,9 +192,7 @@
        */
       public ThreadControl execute( final Executable work )
       {
  -        return
  -            new WrappedThreadControl(
  -                execute( new ExecutableExecuteable( work ) ) );
  +         return execute( new ExecutableExecuteable( work ) );
       }
   
       /**
  
  
  
  1.17      +4 -5      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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- DefaultThreadPool.java	4 Mar 2003 14:34:38 -0000	1.16
  +++ DefaultThreadPool.java	23 Mar 2003 03:00:44 -0000	1.17
  @@ -53,7 +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.excalibur.thread.ThreadControl;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Executable;
   import org.apache.avalon.framework.container.ContainerUtil;
  @@ -148,8 +148,7 @@
        */
       public ThreadControl execute( final Executable work )
       {
  -        return new WrappedThreadControl(
  -            m_pool.execute( new ExecutableExecuteable( work ) ) );
  +        return m_pool.execute( work );
       }
   
       /**
  @@ -159,7 +158,7 @@
        * @param work the work to be executed.
        * @return the ThreadControl
        */
  -    public org.apache.excalibur.thread.ThreadControl execute( final Runnable work )
  +    public ThreadControl execute( final Runnable work )
       {
           return m_pool.execute( work );
       }
  @@ -171,7 +170,7 @@
        * @param work the work to be executed.
        * @return the ThreadControl
        */
  -    public org.apache.excalibur.thread.ThreadControl execute( final org.apache.excalibur.thread.Executable
work )
  +    public ThreadControl execute( final org.apache.excalibur.thread.Executable work )
       {
           return m_pool.execute( work );
       }
  
  
  
  1.14      +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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ResourceLimitingThreadPool.java	4 Mar 2003 14:34:38 -0000	1.13
  +++ ResourceLimitingThreadPool.java	23 Mar 2003 03:00:44 -0000	1.14
  @@ -289,9 +289,9 @@
        * @param work the work to be executed.
        * @return the ThreadControl
        */
  -    public org.apache.avalon.excalibur.thread.ThreadControl execute( final Executable work
)
  +    public ThreadControl execute( final Executable work )
       {
  -        return new WrappedThreadControl( m_pool.execute( work ) );
  +        return m_pool.execute( work );
       }
   
       /**
  
  
  
  1.7       +1 -0      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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ThreadControl.java	4 Mar 2003 14:34:39 -0000	1.6
  +++ ThreadControl.java	23 Mar 2003 03:00:44 -0000	1.7
  @@ -57,6 +57,7 @@
    * @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: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message