You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by do...@apache.org on 2002/05/01 11:11:48 UTC

cvs commit: jakarta-avalon-excalibur/thread/src/java/org/apache/avalon/excalibur/thread/impl DefaultThreadPool.java WorkerThread.java

donaldp     02/05/01 02:11:48

  Modified:    monitor/src/java/org/apache/avalon/excalibur/monitor
                        Resource.java
               sourceresolve/src/java/org/apache/excalibur/source/impl
                        ResourceSourceFactory.java SourceResolverImpl.java
                        URLSource.java
               thread/src/java/org/apache/avalon/excalibur/thread/impl
                        DefaultThreadPool.java WorkerThread.java
  Log:
  Update to latest thread libraries and make sure you duplicate the context before passing it to a new thread (so as not to generate illegalStateExceptions).
  
  Revision  Changes    Path
  1.7       +3 -2      jakarta-avalon-excalibur/monitor/src/java/org/apache/avalon/excalibur/monitor/Resource.java
  
  Index: Resource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/monitor/src/java/org/apache/avalon/excalibur/monitor/Resource.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Resource.java	22 Apr 2002 15:24:26 -0000	1.6
  +++ Resource.java	1 May 2002 09:11:47 -0000	1.7
  @@ -22,9 +22,10 @@
    * last modified property will be enough.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version $Id: Resource.java,v 1.6 2002/04/22 15:24:26 bloritsch Exp $
  + * @version $Id: Resource.java,v 1.7 2002/05/01 09:11:47 donaldp Exp $
    */
  -public abstract class Resource implements Modifiable
  +public abstract class Resource 
  +    implements Modifiable
   {
       protected static final String MODIFIED = "last-modified";
       protected PropertyChangeSupport m_eventSupport = new PropertyChangeSupport( this );
  
  
  
  1.3       +2 -1      jakarta-avalon-excalibur/sourceresolve/src/java/org/apache/excalibur/source/impl/ResourceSourceFactory.java
  
  Index: ResourceSourceFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/sourceresolve/src/java/org/apache/excalibur/source/impl/ResourceSourceFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ResourceSourceFactory.java	24 Apr 2002 12:35:37 -0000	1.2
  +++ ResourceSourceFactory.java	1 May 2002 09:11:47 -0000	1.3
  @@ -16,8 +16,9 @@
   
   /**
    * A factory for the Resource protocol
  + *
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version $Id: ResourceSourceFactory.java,v 1.2 2002/04/24 12:35:37 cziegeler Exp $
  + * @version $Id: ResourceSourceFactory.java,v 1.3 2002/05/01 09:11:47 donaldp Exp $
    */
   public class ResourceSourceFactory
       extends AbstractLogEnabled
  
  
  
  1.4       +9 -9      jakarta-avalon-excalibur/sourceresolve/src/java/org/apache/excalibur/source/impl/SourceResolverImpl.java
  
  Index: SourceResolverImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/sourceresolve/src/java/org/apache/excalibur/source/impl/SourceResolverImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SourceResolverImpl.java	24 Apr 2002 12:35:37 -0000	1.3
  +++ SourceResolverImpl.java	1 May 2002 09:11:47 -0000	1.4
  @@ -51,7 +51,7 @@
    *
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version $Id: SourceResolverImpl.java,v 1.3 2002/04/24 12:35:37 cziegeler Exp $
  + * @version $Id: SourceResolverImpl.java,v 1.4 2002/05/01 09:11:47 donaldp Exp $
    */
   public class SourceResolverImpl
       extends AbstractLogEnabled
  @@ -98,9 +98,9 @@
               try
               {
                   m_baseURL = new File( System.getProperty( "user.dir" ) ).toURL();
  -                if( this.getLogger().isDebugEnabled() )
  +                if( getLogger().isDebugEnabled() )
                   {
  -                    this.getLogger().debug( "SourceResolver: Using base URL: " + m_baseURL );
  +                    getLogger().debug( "SourceResolver: Using base URL: " + m_baseURL );
                   }
               }
               catch( MalformedURLException mue )
  @@ -180,9 +180,9 @@
                                 Map parameters )
           throws MalformedURLException, IOException, SourceException
       {
  -        if( this.getLogger().isDebugEnabled() )
  +        if( getLogger().isDebugEnabled() )
           {
  -            this.getLogger().debug( "Resolving '" + location + "' with base '" + baseURI + "' in context '" + m_baseURL + "'" );
  +            getLogger().debug( "Resolving '" + location + "' with base '" + baseURI + "' in context '" + m_baseURL + "'" );
           }
           if( location == null ) throw new MalformedURLException( "Invalid System ID" );
           if( null != baseURI && baseURI.indexOf( ':' ) == -1 )
  @@ -246,9 +246,9 @@
                   systemID = buffer.toString();
               }
           }
  -        if( this.getLogger().isDebugEnabled() )
  +        if( getLogger().isDebugEnabled() )
           {
  -            this.getLogger().debug( "Resolved to systemID '" + systemID + "'" );
  +            getLogger().debug( "Resolved to systemID '" + systemID + "'" );
           }
   
           Source source = null;
  @@ -281,7 +281,7 @@
               // no factory found, so usual url handling stuff...
               try
               {
  -                if( this.getLogger().isDebugEnabled() == true )
  +                if( getLogger().isDebugEnabled() == true )
                   {
                       this.getLogger().debug( "Making URL from " + systemID );
                   }
  @@ -304,7 +304,7 @@
               }
               catch( MalformedURLException mue )
               {
  -                if( this.getLogger().isDebugEnabled() )
  +                if( getLogger().isDebugEnabled() )
                   {
                       this.getLogger().debug( "Making URL - MalformedURLException in getURL:", mue );
                       this.getLogger().debug( "Making URL a File (assuming that it is full path):" + systemID );
  
  
  
  1.7       +3 -3      jakarta-avalon-excalibur/sourceresolve/src/java/org/apache/excalibur/source/impl/URLSource.java
  
  Index: URLSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/sourceresolve/src/java/org/apache/excalibur/source/impl/URLSource.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- URLSource.java	24 Apr 2002 12:35:37 -0000	1.6
  +++ URLSource.java	1 May 2002 09:11:47 -0000	1.7
  @@ -24,7 +24,7 @@
    * Description of a source which is described by an URL.
    *
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.6 $ $Date: 2002/04/24 12:35:37 $
  + * @version CVS $Revision: 1.7 $ $Date: 2002/05/01 09:11:47 $
    */
   
   public class URLSource
  @@ -175,7 +175,7 @@
        */
       public long getLastModified()
       {
  -        this.getInfos();
  +        getInfos();
           return this.lastModificationDate;
       }
   
  @@ -189,7 +189,7 @@
       public InputStream getInputStream()
           throws IOException, SourceException
       {
  -        this.getInfos();
  +        getInfos();
           InputStream input = null;
           if( this.isFile == true )
           {
  
  
  
  1.3       +3 -2      jakarta-avalon-excalibur/thread/src/java/org/apache/avalon/excalibur/thread/impl/DefaultThreadPool.java
  
  Index: DefaultThreadPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/thread/src/java/org/apache/avalon/excalibur/thread/impl/DefaultThreadPool.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultThreadPool.java	9 Apr 2002 11:32:12 -0000	1.2
  +++ DefaultThreadPool.java	1 May 2002 09:11:47 -0000	1.3
  @@ -77,8 +77,9 @@
   
       public Object newInstance()
       {
  -        final String name = new StringBuffer( getName() ).append( " Worker #" ).append( m_level++ ).toString();
  -        final WorkerThread worker = new WorkerThread( this, name, m_pool, m_context );
  +        final String name = getName() + " Worker #" + m_level++;
  +        final WorkerThread worker = 
  +	    new WorkerThread( this, name, m_pool, m_context.duplicate() );
           worker.setDaemon( true );
           worker.enableLogging( m_logger );
           worker.start();
  
  
  
  1.3       +1 -0      jakarta-avalon-excalibur/thread/src/java/org/apache/avalon/excalibur/thread/impl/WorkerThread.java
  
  Index: WorkerThread.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/thread/src/java/org/apache/avalon/excalibur/thread/impl/WorkerThread.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WorkerThread.java	9 Apr 2002 11:32:12 -0000	1.2
  +++ WorkerThread.java	1 May 2002 09:11:47 -0000	1.3
  @@ -79,6 +79,7 @@
                   if( null != m_context ) ThreadContext.setThreadContext( m_context );
                   m_work.execute();
                   m_threadControl.finish( null );
  +                if( null != m_context ) ThreadContext.setThreadContext( null );
               }
               catch( final ThreadDeath threadDeath )
               {
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>