User: jules_gosnell
  Date: 02/03/05 16:34:34

  Modified:    jetty/src/main/org/jboss/jetty/util NaiveTimeOutManager.java
  Log:
  ensure that timeOut() and timeRemaining() are run with the same
  ContextClassLoader as TimeOut was registered with.
  
  Revision  Changes    Path
  1.10      +14 -6     
contrib/jetty/src/main/org/jboss/jetty/util/NaiveTimeOutManager.java
  
  Index: NaiveTimeOutManager.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/contrib/jetty/src/main/org/jboss/jetty/util/NaiveTimeOutManager.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- NaiveTimeOutManager.java  19 Feb 2002 00:09:01 -0000      1.9
  +++ NaiveTimeOutManager.java  6 Mar 2002 00:34:33 -0000       1.10
  @@ -5,7 +5,7 @@
    * See terms of license at gnu.org.
    */
   
  -// $Id: NaiveTimeOutManager.java,v 1.9 2002/02/19 00:09:01 jules_gosnell Exp $
  +// $Id: NaiveTimeOutManager.java,v 1.10 2002/03/06 00:34:33 jules_gosnell Exp $
   
   //------------------------------------------------------------------------------
   
  @@ -37,7 +37,6 @@
     protected final TimeOutHelper _helper;
     protected Sweeper             _sweeper;
   
  -
     public
       NaiveTimeOutManager(long interval, TimeOutHelper helper)
       {
  @@ -47,13 +46,15 @@
   
     class Entry
     {
  -    final Object _object;
  -    final long   _timeRegistered;
  -    final long   _maxInactiveInterval;
  +    final Object      _object;
  +    final ClassLoader _classLoader;
  +    final long        _timeRegistered;
  +    final long        _maxInactiveInterval;
   
       Entry(Object object, long timeRegistered, long maxInactiveInterval)
       {
         _object=object;
  +      _classLoader=Thread.currentThread().getContextClassLoader();
         _timeRegistered=timeRegistered;
         _maxInactiveInterval=maxInactiveInterval;
       }
  @@ -61,13 +62,20 @@
       long
         getTimeRemaining(long now)
       {
  -      return _helper.timeRemaining(_object, _timeRegistered, now, 
_maxInactiveInterval);
  +      ClassLoader tmp=Thread.currentThread().getContextClassLoader();
  +      Thread.currentThread().setContextClassLoader(_classLoader);
  +      long timeRemaining=_helper.timeRemaining(_object, _timeRegistered, now, 
_maxInactiveInterval);
  +      Thread.currentThread().setContextClassLoader(tmp);
  +      return timeRemaining;
       }
   
       void
         timeOut()
       {
  +      ClassLoader tmp=Thread.currentThread().getContextClassLoader();
  +      Thread.currentThread().setContextClassLoader(_classLoader);
         _helper.timeOut(_object);
  +      Thread.currentThread().setContextClassLoader(tmp);
       }
     }
   
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to