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 LayeredThreadContext.java
Date Fri, 26 Apr 2002 03:39:47 GMT
donaldp     02/04/25 20:39:47

  Modified:    threadcontext/src/java/org/apache/excalibur/threadcontext
                        LayeredThreadContext.java
  Log:
  Correctly cache the thread associated with context
  
  Revision  Changes    Path
  1.4       +7 -5      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LayeredThreadContext.java	10 Apr 2002 10:51:26 -0000	1.3
  +++ LayeredThreadContext.java	26 Apr 2002 03:39:47 -0000	1.4
  @@ -66,7 +66,7 @@
   
       /**
        * This variable is set to the thread that the ThreadContext
  -     * is currently active on. A ThreadContext can not be active 
  +     * is currently active on. A ThreadContext can not be active
        * on multiple threads at the same time.
        */
       private Thread m_activeThread;
  @@ -102,12 +102,12 @@
   
           if( threadContext.isActive() )
           {
  -            throw new IllegalArgumentException( "Specified ThreadContext is already " +

  +            throw new IllegalArgumentException( "Specified ThreadContext is already " +
                                                   "bound to a thread" );
           }
   
           final LayeredThreadContext oldThreadContext = (LayeredThreadContext)c_context.get();
  -        if( null != oldThreadContext ) 
  +        if( null != oldThreadContext )
           {
               oldThreadContext.deactivate();
           }
  @@ -285,6 +285,7 @@
       private void activate()
       {
           m_policy.activate( m_accessor );
  +        m_activeThread = Thread.currentThread();
       }
   
       /**
  @@ -292,13 +293,14 @@
        */
       private void deactivate()
       {
  +        m_activeThread = null;
           m_policy.deactivate( m_accessor );
       }
   
       /**
        * Class that manages inheritance of ThreadContext between threads.
        */
  -    private static class CloningInheritableThreadLocal 
  +    private static class CloningInheritableThreadLocal
           extends InheritableThreadLocal
       {
           protected Object childValue( final Object parentValue )
  @@ -311,7 +313,7 @@
       /**
        * Inner class to offer accessor interface to policy object.
        */
  -    private class InnerThreadContextAccessor 
  +    private class InnerThreadContextAccessor
           implements ThreadContextAccessor
       {
           public boolean containsKey( final String key )
  
  
  

--
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