avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/threadcontext/src/java/org/apache/excalibur/threadcontext DefaultThreadContextPolicy.java Layer.java LayeredThreadContext.java ThreadContext.java ThreadContextAccessor.java ThreadContextPolicy.java
Date Tue, 09 Apr 2002 09:20:55 GMT
donaldp     02/04/09 02:20:54

  Modified:    threadcontext README.txt build.xml project.properties
               threadcontext/src/java/org/apache/excalibur/threadcontext
                        DefaultThreadContextPolicy.java Layer.java
                        LayeredThreadContext.java ThreadContext.java
                        ThreadContextAccessor.java ThreadContextPolicy.java
  Log:
  Rename lang to threadcontext
  
  Revision  Changes    Path
  1.2       +3 -3      jakarta-avalon-excalibur/threadcontext/README.txt
  
  Index: README.txt
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/threadcontext/README.txt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- README.txt	4 Apr 2002 05:09:03 -0000	1.1
  +++ README.txt	9 Apr 2002 09:20:54 -0000	1.2
  @@ -1,7 +1,7 @@
  -                  Avalons Excalibur Lang
  -                  ----------------------
  +                  Avalons Excalibur ThreadContext
  +                  -------------------------------
   
  -This project contains lang utilities.
  +This project contains utilities for managing thread context variables.
   
   Getting Started:
   ----------------
  
  
  
  1.7       +1 -1      jakarta-avalon-excalibur/threadcontext/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/threadcontext/build.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- build.xml	8 Apr 2002 12:15:41 -0000	1.6
  +++ build.xml	9 Apr 2002 09:20:54 -0000	1.7
  @@ -1,6 +1,6 @@
   <?xml version="1.0"?>
   
  -<project name="Excalibur Lang" default="main" basedir=".">
  +<project name="Excalibur ThreadContext" default="main" basedir=".">
   
       <property file="${user.home}/build.properties"/>
       <property file="../ant.properties"/>
  
  
  
  1.3       +3 -3      jakarta-avalon-excalibur/threadcontext/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/threadcontext/project.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project.properties	4 Apr 2002 15:12:50 -0000	1.2
  +++ project.properties	9 Apr 2002 09:20:54 -0000	1.3
  @@ -1,5 +1,5 @@
  -name=excalibur-lang
  -Name=Excalibur Lang
  -dir-name=lang
  +name=excalibur-threadcontext
  +Name=Excalibur ThreadContext
  +dir-name=threadcontext
   version=1.0
   year=2000-2002
  
  
  
  1.2       +5 -2      jakarta-avalon-excalibur/threadcontext/src/java/org/apache/excalibur/threadcontext/DefaultThreadContextPolicy.java
  
  Index: DefaultThreadContextPolicy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/threadcontext/src/java/org/apache/excalibur/threadcontext/DefaultThreadContextPolicy.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultThreadContextPolicy.java	4 Apr 2002 05:09:03 -0000	1.1
  +++ DefaultThreadContextPolicy.java	9 Apr 2002 09:20:54 -0000	1.2
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE.txt file.
    */
  -package org.apache.avalon.excalibur.lang;
  +package org.apache.excalibur.threadcontext;
   
   /**
    * Default <code>ThreadContextPolicy</code> that just maintains the
  @@ -27,7 +27,10 @@
       public void activate( final ThreadContextAccessor accessor )
       {
           final ClassLoader classLoader = (ClassLoader)get( accessor, CLASSLOADER, null,
ClassLoader.class );
  -        if( null != classLoader ) Thread.currentThread().setContextClassLoader( classLoader
);
  +        if( null != classLoader ) 
  +        {
  +            Thread.currentThread().setContextClassLoader( classLoader );
  +        }
       }
   
       /**
  
  
  
  1.2       +1 -1      jakarta-avalon-excalibur/threadcontext/src/java/org/apache/excalibur/threadcontext/Layer.java
  
  Index: Layer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/threadcontext/src/java/org/apache/excalibur/threadcontext/Layer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Layer.java	4 Apr 2002 05:09:03 -0000	1.1
  +++ Layer.java	9 Apr 2002 09:20:54 -0000	1.2
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE.txt file.
    */
  -package org.apache.avalon.excalibur.lang;
  +package org.apache.excalibur.threadcontext;
   
   import java.util.Map;
   
  
  
  
  1.2       +12 -7     jakarta-avalon-excalibur/threadcontext/src/java/org/apache/excalibur/threadcontext/LayeredThreadContext.java
  
  Index: LayeredThreadContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/threadcontext/src/java/org/apache/excalibur/threadcontext/LayeredThreadContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LayeredThreadContext.java	4 Apr 2002 05:09:03 -0000	1.1
  +++ LayeredThreadContext.java	9 Apr 2002 09:20:54 -0000	1.2
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE.txt file.
    */
  -package org.apache.avalon.excalibur.lang;
  +package org.apache.excalibur.threadcontext;
   
   import java.util.ArrayList;
   import java.util.HashMap;
  @@ -93,7 +93,10 @@
           }
   
           final LayeredThreadContext oldThreadContext = (LayeredThreadContext)c_context.get();
  -        if( null != oldThreadContext ) oldThreadContext.deactivate();
  +        if( null != oldThreadContext ) 
  +        {
  +            oldThreadContext.deactivate();
  +        }
   
           c_context.set( threadContext );
           if( null != threadContext )
  @@ -189,7 +192,7 @@
        * @param key the key to look for
        * @return the Object found or null
        */
  -    protected synchronized Object contextGet( final String key )
  +    synchronized Object contextGet( final String key )
       {
           final int size = m_layers.size();
           final int top = size - 1;
  @@ -214,7 +217,7 @@
        * @param key the key to look for
        * @return true if key found, false otherwise
        */
  -    protected synchronized boolean contextContainsKey( final String key )
  +    synchronized boolean contextContainsKey( final String key )
       {
           final int size = m_layers.size();
           final int top = size - 1;
  @@ -238,7 +241,7 @@
        *
        * @return the duplicated context
        */
  -    protected synchronized LayeredThreadContext duplicate()
  +    synchronized LayeredThreadContext duplicate()
       {
           final LayeredThreadContext context = new LayeredThreadContext( m_policy );
   
  @@ -273,7 +276,8 @@
       /**
        * Class that manages inheritance of ThreadContext between threads.
        */
  -    private static class CloningInheritableThreadLocal extends InheritableThreadLocal
  +    private static class CloningInheritableThreadLocal 
  +        extends InheritableThreadLocal
       {
           protected Object childValue( final Object parentValue )
           {
  @@ -285,7 +289,8 @@
       /**
        * Inner class to offer accessor interface to policy object.
        */
  -    private class InnerThreadContextAccessor implements ThreadContextAccessor
  +    private class InnerThreadContextAccessor 
  +        implements ThreadContextAccessor
       {
           public boolean containsKey( final String key )
           {
  
  
  
  1.2       +15 -3     jakarta-avalon-excalibur/threadcontext/src/java/org/apache/excalibur/threadcontext/ThreadContext.java
  
  Index: ThreadContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/threadcontext/src/java/org/apache/excalibur/threadcontext/ThreadContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ThreadContext.java	4 Apr 2002 05:09:03 -0000	1.1
  +++ ThreadContext.java	9 Apr 2002 09:20:54 -0000	1.2
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE.txt file.
    */
  -package org.apache.avalon.excalibur.lang;
  +package org.apache.excalibur.threadcontext;
   
   import java.util.HashMap;
   import java.util.Iterator;
  @@ -85,7 +85,10 @@
           }
   
           final ThreadContext oldThreadContext = (ThreadContext)c_context.get();
  -        if( null != oldThreadContext ) oldThreadContext.deactivate();
  +        if( null != oldThreadContext ) 
  +        { 
  +            oldThreadContext.deactivate();
  +        }
   
           c_context.set( threadContext );
           if( null != threadContext )
  @@ -146,22 +149,31 @@
       /**
        * Inner class to offer accessor interface to policy object.
        */
  -    private class InnerThreadContextAccessor implements ThreadContextAccessor
  +    private class InnerThreadContextAccessor 
  +        implements ThreadContextAccessor
       {
           public boolean containsKey( final String key )
           {
               if( null == m_map )
  +            {
                   return false;
  +            }
               else
  +            {
                   return m_map.containsKey( key );
  +            }
           }
   
           public Object get( final String key )
           {
               if( null == m_map )
  +            {
                   return null;
  +            }
               else
  +            {
                   return m_map.get( key );
  +            }
           }
       }
   }
  
  
  
  1.2       +1 -1      jakarta-avalon-excalibur/threadcontext/src/java/org/apache/excalibur/threadcontext/ThreadContextAccessor.java
  
  Index: ThreadContextAccessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/threadcontext/src/java/org/apache/excalibur/threadcontext/ThreadContextAccessor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ThreadContextAccessor.java	4 Apr 2002 05:09:03 -0000	1.1
  +++ ThreadContextAccessor.java	9 Apr 2002 09:20:54 -0000	1.2
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE.txt file.
    */
  -package org.apache.avalon.excalibur.lang;
  +package org.apache.excalibur.threadcontext;
   
   /**
    * The <code>ThreadContextAccessor</code> is the interface through which
  
  
  
  1.2       +1 -1      jakarta-avalon-excalibur/threadcontext/src/java/org/apache/excalibur/threadcontext/ThreadContextPolicy.java
  
  Index: ThreadContextPolicy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/threadcontext/src/java/org/apache/excalibur/threadcontext/ThreadContextPolicy.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ThreadContextPolicy.java	4 Apr 2002 05:09:03 -0000	1.1
  +++ ThreadContextPolicy.java	9 Apr 2002 09:20:54 -0000	1.2
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE.txt file.
    */
  -package org.apache.avalon.excalibur.lang;
  +package org.apache.excalibur.threadcontext;
   
   /**
    * The <code>ThreadContextPolicy</code> determines the policy with
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message