You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jt...@apache.org on 2002/02/15 05:33:40 UTC

cvs commit: jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/threads ThreadPool.java

jtaylor     02/02/14 20:33:40

  Modified:    src/java/org/apache/stratum/jcs/access CacheAccess.java
                        GroupCacheAccess.java TestCacheAccess.java
               src/java/org/apache/stratum/jcs/auxiliary/disk Disk.java
                        DiskCache.java DiskCacheFactory.java
                        DiskCacheManager.java DiskCacheNoWaitBuffer.java
                        DiskDumper.java DiskLockManager.java
               src/java/org/apache/stratum/jcs/auxiliary/disk/hsql
                        HSQLCache.java HSQLCacheFactory.java
                        HSQLCacheManager.java HSQLCacheNoWaitBuffer.java
               src/java/org/apache/stratum/jcs/auxiliary/disk/jisp
                        JISPCache.java JISPCacheFactory.java
                        JISPCacheManager.java JISPCacheNoWaitBuffer.java
                        JISPKey.java JISPLockManager.java
               src/java/org/apache/stratum/jcs/auxiliary/lateral
                        LateralCache.java LateralCacheFactory.java
                        LateralCacheManager.java LateralCacheMonitor.java
                        LateralCacheNoWait.java
                        LateralCacheNoWaitFacade.java
                        LateralCacheRestore.java
               src/java/org/apache/stratum/jcs/auxiliary/lateral/http/broadcast
                        LateralCacheMulticaster.java
                        LateralCacheThread.java LateralCacheUnicaster.java
               src/java/org/apache/stratum/jcs/auxiliary/lateral/http/remove
                        DeleteLateralCacheMulticaster.java
                        DeleteLateralCacheUnicaster.java
               src/java/org/apache/stratum/jcs/auxiliary/lateral/http/server
                        AbstractDeleteCacheServlet.java
                        DeleteCacheServlet.java
                        LateralCacheServletReciever.java
               src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/tcp
                        LateralCacheTCPListener.java
                        LateralGroupCacheTCPListener.java
                        LateralTCPReceiver.java
                        LateralTCPReceiverConnection.java
                        LateralTCPSender.java LateralTCPService.java
               src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/udp
                        LateralCacheUDPListener.java
                        LateralGroupCacheUDPListener.java
                        LateralUDPReceiver.java LateralUDPSender.java
                        LateralUDPService.java
               src/java/org/apache/stratum/jcs/auxiliary/remote
                        RemoteCache.java RemoteCacheClientTest.java
                        RemoteCacheFactory.java
                        RemoteCacheFailoverRunner.java
                        RemoteCacheListener.java RemoteCacheManager.java
                        RemoteCacheMonitor.java RemoteCacheNoWait.java
                        RemoteCacheNoWaitFacade.java
                        RemoteCacheRestore.java RemoteUtils.java
               src/java/org/apache/stratum/jcs/auxiliary/remote/group
                        RemoteGroupCacheListener.java
               src/java/org/apache/stratum/jcs/auxiliary/remote/server
                        RemoteCacheClusterFactory.java
                        RemoteCacheClusterManager.java
                        RemoteCacheClusterMonitor.java
                        RemoteCacheClusterRestore.java
                        RemoteCacheServer.java
                        RemoteCacheServerFactory.java
                        RemoteCacheServerListener.java
               src/java/org/apache/stratum/jcs/auxiliary/remote/server/group
                        RemoteGroupCacheServerFactory.java
               src/java/org/apache/stratum/jcs/config OptionConverter.java
                        PropertySetter.java
               src/java/org/apache/stratum/jcs/engine Attributes.java
                        CacheAdaptor.java CacheEventQueue.java
                        CacheWatchRepairable.java
               src/java/org/apache/stratum/jcs/engine/control
                        CacheManagerFactory.java
                        CompositeCacheConfigurator.java
                        CompositeCacheManager.java
               src/java/org/apache/stratum/jcs/engine/group
                        GroupCacheManager.java
                        GroupCacheManagerFactory.java
                        GroupRWLockManager.java
               src/java/org/apache/stratum/jcs/engine/memory/lru
                        LRUMemoryCache.java
               src/java/org/apache/stratum/jcs/engine/memory/mru
                        MRUMemoryCache.java
               src/java/org/apache/stratum/jcs/test/servlet
                        ListTestCacheServlet.java
                        SessionExampleServlet.java
               src/java/org/apache/stratum/jcs/utils/config
                        IUtilConstants.java
               src/java/org/apache/stratum/jcs/utils/email
                        SendJavaMailAttachment.java SendMail.java
               src/java/org/apache/stratum/jcs/utils/net LocalHost.java
               src/java/org/apache/stratum/jcs/utils/reuse
                        HashMapPoolManager.java HashtablePoolManager.java
                        ReadWriteLock.java ReadWriteLockManager.java
                        RwLockGC.java
               src/java/org/apache/stratum/jcs/utils/servlet
                        BasicHttpAuthenticator.java
               src/java/org/apache/stratum/jcs/utils/servlet/session
                        DistSession.java DistSessionGC.java
                        DistSessionPoolManager.java DistSessionTracker.java
               src/java/org/apache/stratum/jcs/utils/threads
                        ThreadPool.java
  Removed:     src/java/org/apache/stratum/jcs/utils/log
                        ILogEventQueue.java ILogListener.java
                        LogEventQueue.java LogUtils.java LogViewer.java
                        Logger.java LoggerManager.java
  Log:
  All logging is now done through commons-logging / log4j! There is still a lot
  of cleaning to be done. Specifcally, there are places where I know I got the
  log levels wrong. Too much stuff is logged at debug, need to use warn and info
  more. Also, there is a lot of redundency. But, I was able to remove the
  utils.log package and everything builds and the tests run. It will need more
  comprehensive testing -- we should work on some automated unit tests for the
  more advanced functionality. However this should be a good start.
  
  Revision  Changes    Path
  1.8       +8 -13     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/CacheAccess.java
  
  Index: CacheAccess.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/CacheAccess.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- CacheAccess.java	14 Feb 2002 05:30:50 -0000	1.7
  +++ CacheAccess.java	15 Feb 2002 04:33:35 -0000	1.8
  @@ -72,6 +72,9 @@
   import org.apache.stratum.jcs.engine.control.CacheManagerFactory;
   import org.apache.stratum.jcs.engine.control.CompositeCacheManager;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
  +
   /**
    *  Class which provides interface for all access to the cache. An instance of
    *  this class is tied to a specific cache region. Static methods are provided
  @@ -79,10 +82,13 @@
    *
    *@author     <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
    *@created    February 13, 2002
  - *@version    $Id: CacheAccess.java,v 1.7 2002/02/14 05:30:50 asmuts Exp $
  + *@version    $Id: CacheAccess.java,v 1.8 2002/02/15 04:33:35 jtaylor Exp $
    */
   public class CacheAccess implements ICacheAccess
   {
  +    private static final Log log = 
  +        LogSource.getInstance( CacheAccess.class );
  +
       /**
        *  Cache manager use by the various forms of defineRegion and getAccess
        */
  @@ -448,7 +454,7 @@
           }
           catch ( IOException ioe )
           {
  -            p( ioe.toString() );
  +            log.error( "Failure getting element attributes", ioe );
           }
   
           return attr;
  @@ -470,17 +476,6 @@
       protected String getStats()
       {
           return cacheControl.getStats();
  -    }
  -
  -    /**
  -     *  Wrapper to System.out.println FIXME: Replace (at call points) with
  -     *  logging mechanism.
  -     *
  -     *@param  s  String to print
  -     */
  -    public static void p( String s )
  -    {
  -        System.out.println( s );
       }
   
   
  
  
  
  1.11      +7 -6      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/GroupCacheAccess.java
  
  Index: GroupCacheAccess.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/GroupCacheAccess.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- GroupCacheAccess.java	14 Feb 2002 05:30:50 -0000	1.10
  +++ GroupCacheAccess.java	15 Feb 2002 04:33:35 -0000	1.11
  @@ -78,8 +78,8 @@
   import org.apache.stratum.jcs.engine.group.GroupCacheManagerFactory;
   import org.apache.stratum.jcs.engine.group.GroupId;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   // CACHE
   
  @@ -92,7 +92,9 @@
    */
   public class GroupCacheAccess extends CacheAccess implements IGroupCacheAccess
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( GroupCacheAccess.class );
  +    
       private static boolean SET_ATTR_INVOCATION = true;
       private static boolean REMOVE_ATTR_INVOCATION = false;
   
  @@ -329,12 +331,11 @@
           }
           catch ( Exception ioe )
           {
  -            p( ioe.toString() );
  +            log.error( "Failure getting element attributes", ioe );
           }
           return attr;
       }
  -
  -
  +    
       ////////////////////////////////////////////////
       /**
        *  Gets the attributeNames attribute of the GroupCacheAccess object
  
  
  
  1.10      +5 -9      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/TestCacheAccess.java
  
  Index: TestCacheAccess.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/TestCacheAccess.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TestCacheAccess.java	14 Feb 2002 05:30:50 -0000	1.9
  +++ TestCacheAccess.java	15 Feb 2002 04:33:35 -0000	1.10
  @@ -69,8 +69,8 @@
   import org.apache.stratum.jcs.engine.group.GroupCacheManager;
   import org.apache.stratum.jcs.engine.group.GroupCacheManagerFactory;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   // CACHE
   
  @@ -84,7 +84,9 @@
    */
   public class TestCacheAccess
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( TestCacheAccess.class );
  +        
       static GroupCacheAccess cache_control = null;
   
   
  @@ -99,11 +101,6 @@
   
           try
           {
  -
  -            Logger log = LoggerManager.getLogger( "cacheaccess" );
  -            p( "logLevel = " + log.logLevel );
  -            //log.setLogLevel( log.DEBUG );
  -
               try
               {
   
  @@ -735,6 +732,5 @@
               p( "=" + ( String ) enum.nextElement() );
           }
       }
  -
   }
   // end test
  
  
  
  1.5       +7 -8      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/Disk.java
  
  Index: Disk.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/Disk.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Disk.java	15 Jan 2002 22:25:50 -0000	1.4
  +++ Disk.java	15 Feb 2002 04:33:35 -0000	1.5
  @@ -69,8 +69,8 @@
   
   import org.apache.stratum.jcs.engine.CacheElement;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Provides thread safe access to the underlying random access file.
  @@ -80,12 +80,12 @@
    */
   class Disk
   {
  +    private static final Log log = 
  +        LogSource.getInstance( Disk.class );
   
  -    private final Logger log;
       private final String filepath;
   
       private RandomAccessFile raf;
  -    private static boolean debug = false;
   
   
       //////////////////////////////////////////////////////
  @@ -98,7 +98,6 @@
       Disk( File file )
           throws FileNotFoundException
       {
  -        log = LoggerManager.getLogger( this );
           this.filepath = file.getAbsolutePath();
           raf = new RandomAccessFile( filepath, "rw" );
       }
  @@ -132,7 +131,7 @@
               }
               if ( corrupted )
               {
  -                log.logIt( "The datFile is corrupted" );
  +                log.debug( "The datFile is corrupted" );
                   //reset();
                   return null;
               }
  @@ -150,7 +149,7 @@
           }
           catch ( Exception e )
           {
  -            log.logEx( e, "-- " + raf );
  +            log.error( raf, e );
           }
           return null;
       }
  @@ -188,7 +187,7 @@
        */
       boolean write( byte[] data, long pos )
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "write> pos=" + pos );
               log.debug( raf + " -- data.length = " + data.length );
  
  
  
  1.5       +51 -81    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/DiskCache.java
  
  Index: DiskCache.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/DiskCache.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DiskCache.java	15 Jan 2002 22:25:50 -0000	1.4
  +++ DiskCache.java	15 Feb 2002 04:33:35 -0000	1.5
  @@ -77,8 +77,8 @@
   
   import org.apache.stratum.jcs.utils.data.PropertyGroups;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   ////////////////////////////////////////////////////////////////////////
   /**
  @@ -104,31 +104,19 @@
    */
   public class DiskCache implements ICache, Serializable
   {
  -
  -    Logger log;
  +    private static final Log log = 
  +        LogSource.getInstance( DiskCache.class );
  +        
       private static int numCreated = 0;
       private int numInstances = 0;
   
  -    // trivial debugging that should be removed by the compiler
  -    private final static boolean debug = false;
  -    //true;
  -    private final static boolean debugR = false;
  -    //true;
  -    private final static boolean debugPut = false;
  -    //true;
  -    private final static boolean debugGet = false;
  -    //true;
  -
       private final static DiskLockManager locker = DiskLockManager.getInstance();
       private String fileName;
       private String cacheName;
       private Disk dataFile;
       private Disk keyFile;
       private HashMap keyHash;
  -    // not synchronized to maximize concurrency.
  -    /**
  -     *  Description of the Field
  -     */
  +    
       public boolean isAlive = false;
       private File rafDir;
   
  @@ -208,7 +196,7 @@
           }
           rafDir = new File( rafroot );
           rafDir.mkdirs();
  -        log = LoggerManager.getLogger( this );
  +
           log.info( "rafroot=" + rafroot );
   
           try
  @@ -237,16 +225,16 @@
               }
               catch ( FileNotFoundException e )
               {
  -                log.logEx( e );
  +                log.error( e );
               }
               catch ( Exception e )
               {
  -                log.logEx( e, fileName );
  +                log.error( fileName, e );
               }
           }
           catch ( Exception e )
           {
  -            log.logEx( e );
  +            log.error( e );
   
           }
       }
  @@ -266,14 +254,14 @@
               {
                   keyHash = new HashMap();
               }
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                log.logIt( "LOADKEYS " + fileName + " -- keyHash.size() = " + keyHash.size() );
  +                log.debug( "LOADKEYS " + fileName + " -- keyHash.size() = " + keyHash.size() );
               }
           }
           catch ( Exception e )
           {
  -            log.logEx( e, fileName );
  +            log.error( fileName, e );
           }
           finally
           {
  @@ -291,9 +279,9 @@
       {
           try
           {
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                log.logIt( "SAVEKEYS " + fileName + " -- keyHash.size() = " + keyHash.size() );
  +                log.debug( "SAVEKEYS " + fileName + " -- keyHash.size() = " + keyHash.size() );
               }
               locker.writeLock();
               try
  @@ -312,7 +300,7 @@
           }
           catch ( Exception e )
           {
  -            log.logEx( e );
  +            log.error( e );
           }
       }
       // end saveKeys
  @@ -390,11 +378,7 @@
       public void update( ICacheElement ce )
           throws IOException
       {
  -
  -        if ( debug )
  -        {
  -            p( "update" );
  -        }
  +        log.debug( "update" );
   
           if ( !isAlive )
           {
  @@ -407,10 +391,8 @@
               ce = pe.ice;
               if ( !pe.isSpoolable )
               {
  -                if ( debug )
  -                {
  -                    p( "pe is not spoolable" );
  -                }
  +                log.debug( "pe is not spoolable" );
  +                
                   // it has been plucked from purgatory
                   return;
               }
  @@ -428,9 +410,10 @@
           // assume that the disk cache will never break
           // disk breakage is akin to an out of memory exception
           buffer.purgatory.remove( ce.getKey() );
  -        if ( debug )
  +        
  +        if ( log.isDebugEnabled() )
           {
  -            p( "putting " + ce.getKey() + " on disk, removing from purgatory" );
  +            log.debug( "putting " + ce.getKey() + " on disk, removing from purgatory" );
           }
   
           //System.out.println( "putting " + ce );
  @@ -486,7 +469,7 @@
                   locker.done();
                   // release write lock.
               }
  -            if ( log.logLevel >= log.DEBUG )
  +            if ( log.isDebugEnabled() )
               {
                   log.debug( fileName + " -- put " + ce.getKey() + " on disk at pos " + ded.pos + " size = " + ded.len );
               }
  @@ -497,7 +480,7 @@
           }
           catch ( Exception e )
           {
  -            log.logEx( e, "cacheName = " + cacheName + ", ce.getKey() = " + ce.getKey() );
  +            log.error( "cacheName = " + cacheName + ", ce.getKey() = " + ce.getKey(), e );
               //reset();
           }
           return;
  @@ -543,9 +526,9 @@
       private Serializable get( Serializable key, boolean container, final boolean lock )
       {
   
  -        if ( debugGet )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "getting " + key + " from disk" );
  +            log.debug( "getting " + key + " from disk" );
           }
   
           if ( !isAlive )
  @@ -567,21 +550,22 @@
               DiskElementDescriptor ded = ( DiskElementDescriptor ) keyHash.get( key );
               if ( ded != null )
               {
  -                if ( debugGet )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "found " + key + " on disk" );
  +                    log.debug( "found " + key + " on disk" );
                   }
  +                
                   obj = dataFile.readObject( ded.pos );
               }
               //System.out.println( "got element = " + (CacheElement)obj);
           }
           catch ( NullPointerException e )
           {
  -            log.logEx( e, "cacheName = " + cacheName + ", key = " + key );
  +            log.error( "cacheName = " + cacheName + ", key = " + key, e );
           }
           catch ( Exception e )
           {
  -            log.logEx( e, "cacheName = " + cacheName + ", key = " + key );
  +            log.error( "cacheName = " + cacheName + ", key = " + key, e );
           }
           finally
           {
  @@ -629,7 +613,7 @@
           }
           catch ( Exception e )
           {
  -            log.logEx( e );
  +            log.error( e );
               reset();
           }
           finally
  @@ -653,7 +637,7 @@
           }
           catch ( Exception e )
           {
  -            log.logEx( e );
  +            log.error( e );
               reset();
           }
           finally
  @@ -668,7 +652,7 @@
        */
       public void reset()
       {
  -        log.logIt( "Reseting cache" );
  +        log.debug( "Reseting cache" );
           locker.writeLock();
           try
           {
  @@ -683,7 +667,7 @@
               }
               catch ( Exception e )
               {
  -                log.logEx( e );
  +                log.error( e );
               }
               try
               {
  @@ -693,11 +677,11 @@
               }
               catch ( IOException e )
               {
  -                log.logEx( e, " -- IN RESET" );
  +                log.error( "IN RESET", e );
               }
               catch ( Exception e )
               {
  -                log.logEx( e, " -- IN RESET" );
  +                log.error( "IN RESET", e );
               }
           }
           finally
  @@ -730,7 +714,7 @@
       {
           if ( !isAlive )
           {
  -            log.logIt( "is not alive and close() was called -- " + fileName );
  +            log.debug( "is not alive and close() was called -- " + fileName );
               return;
           }
           locker.writeLock();
  @@ -738,7 +722,7 @@
           {
               if ( !isAlive )
               {
  -                log.logIt( "is not alive and close() was called -- " + fileName );
  +                log.debug( "is not alive and close() was called -- " + fileName );
                   return;
               }
               try
  @@ -747,14 +731,13 @@
               }
               catch ( Exception e )
               {
  -                log.logEx( e, "-- " + fileName );
  +                log.error( fileName, e );
               }
               try
               {
                   numInstances--;
                   if ( numInstances == 0 )
                   {
  -                    p( "dispose -- Closing files -- in close -- " + fileName );
                       log.warn( "dispose -- Closing files -- in close -- " + fileName );
                       dataFile.close();
                       dataFile = null;
  @@ -764,7 +747,7 @@
               }
               catch ( Exception e )
               {
  -                log.logEx( e, "-- " + fileName );
  +                log.error( "-- " + fileName, e );
               }
           }
           finally
  @@ -788,7 +771,7 @@
               // and from dataFile to dataFileTemp on disk.
               HashMap keyHashTemp = new HashMap();
               Disk dataFileTemp = new Disk( new File( rafDir, fileName + "Temp.data" ) );
  -            if ( log.logLevel >= log.INFO )
  +            if ( log.isDebugEnabled() )
               {
                   log.info( "optomizing file keyHash.size()=" + keyHash.size() );
               }
  @@ -802,7 +785,7 @@
                   try
                   {
                       DiskElementDescriptor de = dataFileTemp.appendObject( tempDe );
  -                    if ( log.logLevel >= log.DEBUG )
  +                    if ( log.isDebugEnabled() )
                       {
                           log.debug( fileName + " -- Put " + key + " on temp disk cache" );
                       }
  @@ -810,12 +793,12 @@
                   }
                   catch ( Exception e )
                   {
  -                    log.logEx( e, fileName + " -- cacheName = " + cacheName + ", key = "
  -                         + key );
  +                    log.error( fileName + " -- cacheName = " 
  +                               + cacheName + ", key = " + key, e );
                   }
               }
               // end while
  -            if ( log.logLevel >= log.DEBUG )
  +            if ( log.isDebugEnabled() )
               {
                   log.debug( fileName + " -- keyHashTemp.size() =  " + keyHashTemp.size()
                        + " / keyHash.size() =  " + keyHash.size() );
  @@ -826,9 +809,9 @@
               File oldData = new File( rafDir, fileName + ".data" );
               if ( oldData.exists() )
               {
  -                if ( debugR )
  +                if ( log.isDebugEnabled() )
                   {
  -                    log.logIt( fileName + " -- oldData.length() = " + oldData.length() );
  +                    log.debug( fileName + " -- oldData.length() = " + oldData.length() );
                   }
                   oldData.delete();
               }
  @@ -836,9 +819,9 @@
               File newFileName = new File( rafDir, fileName + ".data" );
               if ( newData.exists() )
               {
  -                if ( debugR )
  +                if ( log.isDebugEnabled() )
                   {
  -                    log.logIt( fileName + " -- newData.length() = " + newData.length() );
  +                    log.debug( fileName + " -- newData.length() = " + newData.length() );
                   }
                   newData.renameTo( newFileName );
               }
  @@ -848,7 +831,7 @@
           }
           catch ( Exception e )
           {
  -            log.logEx( e, "-- " + fileName );
  +            log.error( fileName, e );
           }
       }
       // end optimizeFile
  @@ -903,18 +886,6 @@
       }
   
   
  -    //////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    public void p( String s )
  -    {
  -        System.out.println( "DiskCache: " + s );
  -    }
  -
  -
       /**
        *  Returns cache name, ha
        *
  @@ -925,6 +896,5 @@
           return cacheName;
       }
   }
  -// end class
   
   
  
  
  
  1.5       +4 -4      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/DiskCacheFactory.java
  
  Index: DiskCacheFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/DiskCacheFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DiskCacheFactory.java	15 Jan 2002 22:25:50 -0000	1.4
  +++ DiskCacheFactory.java	15 Feb 2002 04:33:35 -0000	1.5
  @@ -61,8 +61,8 @@
   
   import org.apache.stratum.jcs.engine.behavior.ICache;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Title: Description: Copyright: Copyright (c) 2001 Company:
  @@ -75,8 +75,8 @@
   ///////////////////////////////////////////////////////////////
   public class DiskCacheFactory implements IAuxiliaryCacheFactory
   {
  -
  -    private static Logger log = LoggerManager.getLogger( DiskCacheFactory.class );
  +    private static final Log log = 
  +        LogSource.getInstance( DiskCacheFactory.class );
   
       private static String name;
   
  
  
  
  1.5       +10 -36    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/DiskCacheManager.java
  
  Index: DiskCacheManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/DiskCacheManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DiskCacheManager.java	15 Jan 2002 22:25:50 -0000	1.4
  +++ DiskCacheManager.java	15 Feb 2002 04:33:35 -0000	1.5
  @@ -62,8 +62,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICache;
   import org.apache.stratum.jcs.engine.behavior.ICacheManager;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /////////////////////////////////////////////
   /**
  @@ -74,17 +74,13 @@
    */
   public class DiskCacheManager implements ICacheManager
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( DiskCacheManager.class );
  +        
       private static int clients;
   
       private static Hashtable caches = new Hashtable();
   
  -    private static Logger log;
  -    private final static boolean debug = false;
  -    //true;
  -    private final static boolean pOut = false;
  -    //true;
  -
       private static DiskCacheManager instance;
   
       private static IDiskCacheAttributes defaultCattr;
  @@ -98,7 +94,6 @@
        */
       private DiskCacheManager( IDiskCacheAttributes cattr )
       {
  -        log = LoggerManager.getLogger( this );
           this.defaultCattr = cattr;
       }
   
  @@ -134,9 +129,9 @@
                   }
               }
           }
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            log.logIt( "Manager stats : " + instance.getStats() + "<br> -- in getInstance()" );
  +            log.debug( "Manager stats : " + instance.getStats() + "-- in getInstance()" );
           }
           clients++;
           return instance;
  @@ -169,7 +164,7 @@
       {
           ICache raf = null;
   
  -        p( "cacheName = " + cattr.getCacheName() );
  +        log.debug( "cacheName = " + cattr.getCacheName() );
   
           synchronized ( caches )
           {
  @@ -183,9 +178,9 @@
                   caches.put( cattr.getCacheName(), raf );
               }
           }
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            log.logIt( "Manager stats : " + instance.getStats() );
  +            log.debug( "Manager stats : " + instance.getStats() );
           }
           return raf;
       }
  @@ -267,25 +262,4 @@
               }
           }
       }
  -    //end release()
  -
  -    /////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    public void p( String s )
  -    {
  -        if ( log.logLevel >= log.DEBUG )
  -        {
  -            log.debug( s );
  -        }
  -        if ( pOut )
  -        {
  -            System.out.println( "DiskCacheManager: " + s );
  -        }
  -    }
  -
   }
  -// end class
  
  
  
  1.5       +13 -30    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/DiskCacheNoWaitBuffer.java
  
  Index: DiskCacheNoWaitBuffer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/DiskCacheNoWaitBuffer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DiskCacheNoWaitBuffer.java	15 Jan 2002 22:25:50 -0000	1.4
  +++ DiskCacheNoWaitBuffer.java	15 Feb 2002 04:33:35 -0000	1.5
  @@ -72,8 +72,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   import org.apache.stratum.jcs.engine.behavior.ICacheEventQueue;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Store recent arivals in a temporary queue. Used to queue up update requests
  @@ -93,22 +93,19 @@
    */
   public class DiskCacheNoWaitBuffer implements ICache
   {
  -
  -    private final static boolean debug = false;
  -    //true;
  -
  -    // accessed by disk cache
  +    private static final Log log = 
  +        LogSource.getInstance( DiskCacheNoWaitBuffer.class );
  +        
       /**
        *  Description of the Field
        */
       protected Hashtable purgatory = new Hashtable();
  -    private final static boolean debugPH = true;
  +
       private int purgHits = 0;
   
       private IDiskCacheAttributes cattr;
       private DiskCache cache;
       private ICacheEventQueue q;
  -    private transient Logger log = LoggerManager.getInstance().getLogger( this );
   
       private String source_id = "org.apache.stratum.jcs.auxiliary.disk.DiskCacheNoWaitBuffer";
   
  @@ -199,10 +196,7 @@
       {
           try
           {
  -            if ( debug )
  -            {
  -                p( "putting in purgatory" );
  -            }
  +            log.debug( "putting in purgatory" );
   
               PurgatoryElement pe = new PurgatoryElement( ce );
               pe.isSpoolable = true;
  @@ -257,20 +251,20 @@
           if ( pe != null )
           {
               purgHits++;
  -            if ( debugPH )
  +            
  +            if ( log.isDebugEnabled() )
               {
                   if ( purgHits % 100 == 0 )
                   {
  -                    p( "purgatory hits = " + purgHits );
  +                    log.debug( "purgatory hits = " + purgHits );
                   }
               }
   
               //ide.setIsSpoolable( false );
               pe.isSpoolable = false;
  -            if ( debug )
  -            {
  -                p( "found in purgatory" );
  -            }
  +            
  +            log.debug( "found in purgatory" );
  +            
               if ( container )
               {
                   purgatory.remove( key );
  @@ -455,16 +449,5 @@
       public String toString()
       {
           return "DiskCacheNoWaitBuffer: " + cache.toString();
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        System.out.println( "DiskCacheNoWaitBuffer:" + s );
       }
   }
  
  
  
  1.5       +1 -13     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/DiskDumper.java
  
  Index: DiskDumper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/DiskDumper.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DiskDumper.java	15 Jan 2002 22:25:50 -0000	1.4
  +++ DiskDumper.java	15 Feb 2002 04:33:35 -0000	1.5
  @@ -73,23 +73,11 @@
       {
           if ( args.length != 1 )
           {
  -            p( "Usage: java org.apache.stratum.jcs.auxiliary.disk.DiskDump <cache_name>" );
  +            System.out.println( "Usage: java org.apache.stratum.jcs.auxiliary.disk.DiskDump <cache_name>" );
               System.exit( 0 );
           }
           final DiskCache rc = new DiskCache( args[0], args[0] );
           rc.dump();
           System.exit( 0 );
       }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p( String s )
  -    {
  -        System.out.println( "DiskCache:" + s );
  -    }
  -
   }
  
  
  
  1.5       +0 -1      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/DiskLockManager.java
  
  Index: DiskLockManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/DiskLockManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DiskLockManager.java	15 Jan 2002 22:25:50 -0000	1.4
  +++ DiskLockManager.java	15 Feb 2002 04:33:35 -0000	1.5
  @@ -74,7 +74,6 @@
       public final static String Disk = "Disk";
       private static DiskLockManager instance;
   
  -    boolean debug = false;
       private final Hashtable ht = new Hashtable();
   
   
  
  
  
  1.6       +25 -75    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/HSQLCache.java
  
  Index: HSQLCache.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/HSQLCache.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- HSQLCache.java	18 Jan 2002 01:48:46 -0000	1.5
  +++ HSQLCache.java	15 Feb 2002 04:33:35 -0000	1.6
  @@ -83,8 +83,8 @@
   
   import org.apache.stratum.jcs.utils.data.PropertyGroups;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   ////////////////////////////////////////////////////////////////////////
   /**
  @@ -94,21 +94,12 @@
    */
   public class HSQLCache implements ICache, Serializable
   {
  +    private static final Log log = 
  +        LogSource.getInstance( HSQLCache.class );
   
  -    private static Logger log;
       private static int numCreated = 0;
       private int numInstances = 0;
   
  -    // trivial debugging that should be removed by the compiler
  -    private final static boolean debug = false;
  -    //true;
  -    private final static boolean debugR = false;
  -    //true;
  -    private final static boolean debugPut = false;
  -    //true;
  -    private final static boolean debugGet = false;
  -    //true;
  -
       private String cacheName;
   
       /**
  @@ -186,8 +177,6 @@
       {
           numInstances++;
   
  -        log = LoggerManager.getLogger( this );
  -
           this.cacheName = cacheName;
   
           //String rafroot = cattr.getDiskPath();
  @@ -214,20 +203,18 @@
               String user = p.getProperty( "user", "sa" );
               String password = p.getProperty( "password", "" );
               boolean test = p.getProperty( "test", "true" ).equalsIgnoreCase( "true" );
  -            boolean log = p.getProperty( "log", "true" ).equalsIgnoreCase( "true" );
  +            // boolean log = p.getProperty( "log", "true" ).equalsIgnoreCase( "true" );
   
               try
               {
  -                if ( log )
  +                if ( log.isDebugEnabled() )
                   {
  -                    trace( "driver  =" + driver );
  -                    trace( "url     =" + url );
  -                    trace( "database=" + database );
  -                    trace( "user    =" + user );
  -                    trace( "password=" + password );
  -                    trace( "test    =" + test );
  -                    trace( "log     =" + log );
  -                    //DriverManager.setLogStream(System.out);
  +                    log.debug( "driver  =" + driver
  +                        + ", url = " + url
  +                        + ", database = " + database
  +                        + ", user = " + user
  +                        + ", password = " + password
  +                        + ", test = " + test );
                   }
   
                   // As described in the JDBC FAQ:
  @@ -256,14 +243,13 @@
               }
               catch ( Exception e )
               {
  -                p( "QueryTool.init: " + e.getMessage() );
  -                e.printStackTrace();
  +                log.error( "QueryTool.init", e );
               }
   
           }
           catch ( Exception e )
           {
  -            log.logEx( e );
  +            log.error( e );
           }
   
       }
  @@ -388,11 +374,7 @@
       public void update( ICacheElement ce )
           throws IOException
       {
  -
  -        if ( debug )
  -        {
  -            p( "update" );
  -        }
  +        log.debug( "update" );
   
           if ( !isAlive )
           {
  @@ -405,10 +387,8 @@
               ce = pe.ice;
               if ( !pe.isSpoolable )
               {
  -                if ( debug )
  -                {
  -                    p( "pe is not spoolable" );
  -                }
  +                log.debug( "pe is not spoolable" );
  +                
                   // it has been plucked from purgatory
                   return;
               }
  @@ -426,14 +406,10 @@
           // assume that the disk cache will never break
           // disk breakage is akin to an out of memory exception
           buffer.purgatory.remove( ce.getKey() );
  -        if ( debug )
  +        
  +        if ( log.isDebugEnabled() )
           {
  -            p( "putting " + ce.getKey() + " on disk, removing from purgatory" );
  -        }
  -
  -        if ( debug )
  -        {
  -            p( "putting " + ce );
  +            log.debug( "putting " + ce.getKey() + " on disk, removing from purgatory" );
           }
   
           // remove single item.
  @@ -560,7 +536,7 @@
   //      } finally {
   //        locker.done();          // release write lock.
   //      }
  -//      if ( log.logLevel >= log.DEBUG ) {
  +//      if ( log.isDebugEnabled() ) {
   //        log.debug(fileName + " -- put " + ce.getKey() + " on disk at pos " + ded.pos + " size = " + ded.len );
   //      }
   //    } catch( ConcurrentModificationException cme ) {
  @@ -612,9 +588,9 @@
       private Serializable get( Serializable key, boolean container, final boolean lock )
       {
   
  -        if ( debugGet )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "getting " + key + " from disk" );
  +            log.debug( "getting " + key + " from disk" );
           }
   
           if ( !isAlive )
  @@ -737,7 +713,7 @@
           }
           catch ( Exception e )
           {
  -            log.logEx( e );
  +            log.error( e );
               reset();
           }
           return false;
  @@ -756,7 +732,7 @@
           }
           catch ( RuntimeException e )
           {
  -            log.logEx( e );
  +            log.error( e );
               //reset();
           }
       }
  @@ -901,32 +877,6 @@
   //      log.debug("disk dump> key=" + key + ", val=" + val + ", pos=" + ded.pos);
   //    }
       }
  -
  -
  -    //////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    void trace( String s )
  -    {
  -        p( s );
  -    }
  -
  -    //////////////
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    public void p( String s )
  -    {
  -        log.debug( s );
  -        //System.out.println( "HSQLCache: " + s );
  -    }
  -
   
       /**
        *  Returns cache name, ha
  
  
  
  1.5       +5 -5      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/HSQLCacheFactory.java
  
  Index: HSQLCacheFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/HSQLCacheFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HSQLCacheFactory.java	15 Jan 2002 22:25:51 -0000	1.4
  +++ HSQLCacheFactory.java	15 Feb 2002 04:33:35 -0000	1.5
  @@ -61,8 +61,8 @@
   
   import org.apache.stratum.jcs.engine.behavior.ICache;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *@author     Aaron Smuts
  @@ -73,9 +73,9 @@
   ///////////////////////////////////////////////////////////////
   public class HSQLCacheFactory implements IAuxiliaryCacheFactory
   {
  -
  -    private static Logger log = LoggerManager.getLogger( HSQLCacheFactory.class );
  -
  +    private static final Log log = 
  +        LogSource.getInstance( HSQLCacheFactory.class );
  +        
       private static String name;
   
   
  
  
  
  1.5       +11 -36    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/HSQLCacheManager.java
  
  Index: HSQLCacheManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/HSQLCacheManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HSQLCacheManager.java	15 Jan 2002 22:25:51 -0000	1.4
  +++ HSQLCacheManager.java	15 Feb 2002 04:33:35 -0000	1.5
  @@ -62,8 +62,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICache;
   import org.apache.stratum.jcs.engine.behavior.ICacheManager;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /////////////////////////////////////////////
   /**
  @@ -74,17 +74,13 @@
    */
   public class HSQLCacheManager implements ICacheManager
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( HSQLCacheManager.class );
  +    
       private static int clients;
   
       private static Hashtable caches = new Hashtable();
   
  -    private static Logger log;
  -    private final static boolean debug = false;
  -    //true;
  -    private final static boolean pOut = false;
  -    //true;
  -
       private static HSQLCacheManager instance;
   
       private static IHSQLCacheAttributes defaultCattr;
  @@ -98,7 +94,6 @@
        */
       private HSQLCacheManager( IHSQLCacheAttributes cattr )
       {
  -        log = LoggerManager.getLogger( this );
           this.defaultCattr = cattr;
       }
   
  @@ -134,9 +129,9 @@
                   }
               }
           }
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            log.logIt( "Manager stats : " + instance.getStats() + "<br> -- in getInstance()" );
  +            log.debug( "Manager stats : " + instance.getStats() + " -- in getInstance()" );
           }
           clients++;
           return instance;
  @@ -169,7 +164,7 @@
       {
           ICache raf = null;
   
  -        p( "cacheName = " + cattr.getCacheName() );
  +        log.debug( "cacheName = " + cattr.getCacheName() );
   
           synchronized ( caches )
           {
  @@ -183,9 +178,9 @@
                   caches.put( cattr.getCacheName(), raf );
               }
           }
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            log.logIt( "Manager stats : " + instance.getStats() );
  +            log.debug( "Manager stats : " + instance.getStats() );
           }
           return raf;
       }
  @@ -267,25 +262,5 @@
               }
           }
       }
  -    //end release()
  -
  -    /////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    public void p( String s )
  -    {
  -        if ( log.logLevel >= log.DEBUG )
  -        {
  -            log.debug( s );
  -        }
  -        if ( pOut )
  -        {
  -            System.out.println( "HSQLCacheManager: " + s );
  -        }
  -    }
  -
   }
  -// end class
  +
  
  
  
  1.5       +13 -33    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/HSQLCacheNoWaitBuffer.java
  
  Index: HSQLCacheNoWaitBuffer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/HSQLCacheNoWaitBuffer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HSQLCacheNoWaitBuffer.java	15 Jan 2002 22:25:51 -0000	1.4
  +++ HSQLCacheNoWaitBuffer.java	15 Feb 2002 04:33:35 -0000	1.5
  @@ -72,8 +72,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   import org.apache.stratum.jcs.engine.behavior.ICacheEventQueue;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Store recent arivals in a temporary queue. Used to queue up update requests
  @@ -93,22 +93,16 @@
    */
   public class HSQLCacheNoWaitBuffer implements ICache
   {
  -
  -    private final static boolean debug = false;
  -    //true;
  -
  -    // accessed by disk cache
  -    /**
  -     *  Description of the Field
  -     */
  +    private static final Log log = 
  +        LogSource.getInstance( HSQLCacheNoWaitBuffer.class );
  +        
       protected Hashtable purgatory = new Hashtable();
  -    private final static boolean debugPH = true;
  +
       private int purgHits = 0;
   
       private IHSQLCacheAttributes cattr;
       private HSQLCache cache;
       private ICacheEventQueue q;
  -    private transient Logger log = LoggerManager.getInstance().getLogger( this );
   
       private String source_id = "org.apache.stratum.jcs.auxiliary.disk.HSQLCacheNoWaitBuffer";
   
  @@ -199,10 +193,7 @@
       {
           try
           {
  -            if ( debug )
  -            {
  -                p( "putting in purgatory" );
  -            }
  +            log.debug( "putting in purgatory" );
   
               PurgatoryElement pe = new PurgatoryElement( ce );
               pe.isSpoolable = true;
  @@ -257,20 +248,20 @@
           if ( pe != null )
           {
               purgHits++;
  -            if ( debugPH )
  +            
  +            if ( log.isDebugEnabled() )
               {
                   if ( purgHits % 100 == 0 )
                   {
  -                    p( "purgatory hits = " + purgHits );
  +                    log.debug( "purgatory hits = " + purgHits );
                   }
               }
   
               //ide.setIsSpoolable( false );
               pe.isSpoolable = false;
  -            if ( debug )
  -            {
  -                p( "found in purgatory" );
  -            }
  +            
  +            log.debug( "found in purgatory" );
  +            
               if ( container )
               {
                   purgatory.remove( key );
  @@ -455,16 +446,5 @@
       public String toString()
       {
           return "HSQLCacheNoWaitBuffer: " + cache.toString();
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        System.out.println( "HSQLCacheNoWaitBuffer:" + s );
       }
   }
  
  
  
  1.12      +20 -54    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCache.java
  
  Index: JISPCache.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCache.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JISPCache.java	29 Jan 2002 06:12:57 -0000	1.11
  +++ JISPCache.java	15 Feb 2002 04:33:35 -0000	1.12
  @@ -72,8 +72,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICache;
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   ////////////////////////////////////////////////////////////////////////
   /**
  @@ -85,17 +85,12 @@
    */
   public class JISPCache implements ICache, Serializable
   {
  -
  -    private static Logger log;
  +    private static final Log log = 
  +        LogSource.getInstance( JISPCache.class );
  +        
       private static int numCreated = 0;
       private int numInstances = 0;
   
  -    // trivial debugging that should be removed by the compiler
  -    private final static boolean debug = false;//true;
  -    private final static boolean debugR = false;//true;
  -    private final static boolean debugPut = false;//true;//false;
  -    private final static boolean debugGet = false;//true;//false;
  -
       private String cacheName;
   
       /**
  @@ -160,9 +155,6 @@
       {
           numInstances++;
   
  -        // TODO: Change to log4j
  -        log = LoggerManager.getLogger( this );
  -
           String rafroot = cattr.getDiskPath();
   
           this.cacheName = cattr.getCacheName();
  @@ -176,7 +168,8 @@
           jispDataFileName = rafroot + cacheName + "DATA.jisp";
           jispIndexFileName = rafroot + cacheName + "INDEX.jisp";
   
  -        p( "jispDataFileName = " + jispDataFileName );
  +        log.debug( "jispDataFileName = " + jispDataFileName );
  +        
           ////////////////////////////////////////
           // See if the JISP Cache has already been created.
           // build b-tree database if it doesn't already exist
  @@ -205,9 +198,8 @@
           }
           catch ( Exception e )
           {
  -            p( "QueryTool.init: " + e.getMessage() );
  -            e.printStackTrace();
  -            log.error( e );
  +            log.error( "QueryTool.init", e );
  +
               reset();
           }
   
  @@ -350,11 +342,7 @@
       public void update( ICacheElement ce )
           throws IOException
       {
  -
  -        if ( debug )
  -        {
  -            p( "update" );
  -        }
  +        log.debug( "update" );
   
           if ( !isAlive )
           {
  @@ -368,10 +356,8 @@
               ce = pe.ice;
               if ( !pe.isSpoolable )
               {
  -                if ( debug )
  -                {
  -                    p( "pe is not spoolable" );
  -                }
  +                log.debug( "pe is not spoolable" );
  +                
                   // it has been plucked from purgatory
                   return;
               }
  @@ -381,14 +367,9 @@
           // assume that the disk cache will never break
           // disk breakage is akin to an out of memory exception
           buffer.purgatory.remove( ce.getKey() );
  -        if ( debug )
  -        {
  -            p( "\n putting " + ce.getKey() + " on disk, removing from purgatory" );
  -        }
  -
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "putting " + ce );
  +            log.debug( "\n putting " + ce.getKey() + " on disk, removing from purgatory" );
           }
   
           // make sure this only locks for one particular cache region
  @@ -457,9 +438,9 @@
       private Serializable get( Serializable key, boolean container, final boolean lock )
       {
   
  -        if ( debugGet )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "getting " + key + " from disk" );
  +            log.debug( "getting " + key + " from disk" );
           }
   
           if ( !isAlive )
  @@ -485,9 +466,9 @@
               return null;
           }
   
  -        if ( debugGet )
  +        if ( log.isDebugEnabled() )
           {
  -            p( " " + key + ", val = " + obj.getVal() );
  +            log.debug( " " + key + ", val = " + obj.getVal() );
           }
   
           if ( container )
  @@ -583,7 +564,7 @@
               }
               catch ( Exception e2 )
               {
  -                log.error( e2, "Could not create error files!" );
  +                log.error( "Could not create error files!", e2 );
               }
           }
       }
  @@ -612,7 +593,7 @@
   
           if ( !isAlive )
           {
  -            log.logIt( "is not alive and close() was called -- " + this.jispDataFileName );
  +            log.error( "is not alive and close() was called -- " + this.jispDataFileName );
               return;
           }
   
  @@ -684,19 +665,6 @@
   //    }
       }
   
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    public void p( String s )
  -    {
  -        log.debug( s );
  -        System.out.println( "JISPCache: " + s );
  -    }
  -
  -
       /**
        *  Returns cache name, ha
        *
  @@ -706,8 +674,6 @@
       {
           return cacheName;
       }
  -
   }
  -// end class
   
   
  
  
  
  1.4       +4 -5      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCacheFactory.java
  
  Index: JISPCacheFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCacheFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JISPCacheFactory.java	15 Jan 2002 21:33:30 -0000	1.3
  +++ JISPCacheFactory.java	15 Feb 2002 04:33:35 -0000	1.4
  @@ -14,8 +14,8 @@
   
   import org.apache.stratum.jcs.engine.behavior.ICache;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *@author     Aaron Smuts
  @@ -26,11 +26,10 @@
   ///////////////////////////////////////////////////////////////
   public class JISPCacheFactory implements IAuxiliaryCacheFactory
   {
  -
  -    private static Logger log = LoggerManager.getLogger( JISPCacheFactory.class );
  +    private static final Log log = 
  +        LogSource.getInstance( JISPCacheFactory.class );
   
       private static String name;
  -
   
       ///////////////////////////////////////////////
       /**
  
  
  
  1.4       +10 -36    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCacheManager.java
  
  Index: JISPCacheManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCacheManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JISPCacheManager.java	15 Jan 2002 21:33:30 -0000	1.3
  +++ JISPCacheManager.java	15 Feb 2002 04:33:35 -0000	1.4
  @@ -15,8 +15,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICache;
   import org.apache.stratum.jcs.engine.behavior.ICacheManager;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /////////////////////////////////////////////
   /**
  @@ -27,17 +27,13 @@
    */
   public class JISPCacheManager implements ICacheManager
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( JISPCacheManager.class );
  +        
       private static int clients;
   
       private static Hashtable caches = new Hashtable();
   
  -    private static Logger log;
  -    private final static boolean debug = false;
  -    //true;
  -    private final static boolean pOut = false;
  -    //true;
  -
       private static JISPCacheManager instance;
   
       private static IJISPCacheAttributes defaultCattr;
  @@ -51,7 +47,6 @@
        */
       private JISPCacheManager( IJISPCacheAttributes cattr )
       {
  -        log = LoggerManager.getLogger( this );
           this.defaultCattr = cattr;
       }
   
  @@ -87,9 +82,9 @@
                   }
               }
           }
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            log.logIt( "Manager stats : " + instance.getStats() + "<br> -- in getInstance()" );
  +            log.debug( "Manager stats : " + instance.getStats() + "-- in getInstance()" );
           }
           clients++;
           return instance;
  @@ -122,7 +117,7 @@
       {
           ICache raf = null;
   
  -        p( "cacheName = " + cattr.getCacheName() );
  +        log.debug( "cacheName = " + cattr.getCacheName() );
   
           synchronized ( caches )
           {
  @@ -136,9 +131,9 @@
                   caches.put( cattr.getCacheName(), raf );
               }
           }
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            log.logIt( "Manager stats : " + instance.getStats() );
  +            log.debug( "Manager stats : " + instance.getStats() );
           }
           return raf;
       }
  @@ -220,25 +215,4 @@
               }
           }
       }
  -    //end release()
  -
  -    /////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    public void p( String s )
  -    {
  -        if ( log.logLevel >= log.DEBUG )
  -        {
  -            log.debug( s );
  -        }
  -        if ( pOut )
  -        {
  -            System.out.println( "JISPCacheManager: " + s );
  -        }
  -    }
  -
   }
  -// end class
  
  
  
  1.4       +12 -34    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCacheNoWaitBuffer.java
  
  Index: JISPCacheNoWaitBuffer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCacheNoWaitBuffer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JISPCacheNoWaitBuffer.java	15 Jan 2002 21:33:30 -0000	1.3
  +++ JISPCacheNoWaitBuffer.java	15 Feb 2002 04:33:35 -0000	1.4
  @@ -25,8 +25,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   import org.apache.stratum.jcs.engine.behavior.ICacheEventQueue;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Store recent arivals in a temporary queue. Used to queue up update requests
  @@ -46,23 +46,16 @@
    */
   public class JISPCacheNoWaitBuffer implements ICache
   {
  -
  -    private final static boolean debug = false;
  -    //true;
  -
  -    // accessed by disk cache
  -    /**
  -     *  Description of the Field
  -     */
  +    private static final Log log = 
  +        LogSource.getInstance( JISPCacheNoWaitBuffer.class );
  +        
       protected Hashtable purgatory = new Hashtable();
  -    private final static boolean debugPH = false;
  -    //true;
  +
       private int purgHits = 0;
   
       private IJISPCacheAttributes cattr;
       private JISPCache cache;
       private ICacheEventQueue q;
  -    private transient Logger log = LoggerManager.getInstance().getLogger( this );
   
       private String source_id = "org.apache.stratum.jcs.auxiliary.disk.jisp.JISPCacheNoWaitBuffer";
   
  @@ -153,10 +146,7 @@
       {
           try
           {
  -            if ( debug )
  -            {
  -                p( "putting in purgatory" );
  -            }
  +            log.debug( "putting in purgatory" );
   
               PurgatoryElement pe = new PurgatoryElement( ce );
               pe.isSpoolable = true;
  @@ -211,20 +201,19 @@
           if ( pe != null )
           {
               purgHits++;
  -            if ( debugPH )
  +            if ( log.isDebugEnabled() )
               {
                   if ( purgHits % 100 == 0 )
                   {
  -                    p( "purgatory hits = " + purgHits );
  +                    log.debug( "purgatory hits = " + purgHits );
                   }
               }
   
               //ide.setIsSpoolable( false );
               pe.isSpoolable = false;
  -            if ( debug )
  -            {
  -                p( "found in purgatory" );
  -            }
  +            
  +            log.debug( "found in purgatory" );
  +            
               if ( container )
               {
                   purgatory.remove( key );
  @@ -409,16 +398,5 @@
       public String toString()
       {
           return "JISPCacheNoWaitBuffer: " + cache.toString();
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        System.out.println( "JISPCacheNoWaitBuffer:" + s );
       }
   }
  
  
  
  1.5       +12 -24    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPKey.java
  
  Index: JISPKey.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPKey.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JISPKey.java	29 Jan 2002 06:12:57 -0000	1.4
  +++ JISPKey.java	15 Feb 2002 04:33:35 -0000	1.5
  @@ -14,6 +14,9 @@
   import java.io.ObjectOutput;
   import java.io.Serializable;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
  +
   /**
    *  Description of the Class
    *
  @@ -22,13 +25,9 @@
    */
   public class JISPKey extends KeyObject
   {
  -
  -    // for simple debugging
  -    private final static boolean debug = false;//true;
  -
  -    //
  -    // working storage
  -    //
  +    private static final Log log = 
  +        LogSource.getInstance( JISPKey.class );
  +    
       /**
        *  Description of the Field
        */
  @@ -70,9 +69,9 @@
               //int orig = ( ( JISPKey ) key ).m_key.hashCode();
               int orig = m_key.hashCode();
               int test = key.hashCode();
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "orig = " + orig + ", test = " + test );
  +                log.debug( "orig = " + orig + ", test = " + test );
               }
               int cv = test - orig;
               if ( cv == 0 )
  @@ -174,9 +173,9 @@
           {
               int orig = m_key.hashCode();
               int test = ( ( JISPKey ) obj ).m_key.hashCode();
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "orig = " + orig + ", test = " + test );
  +                log.debug( "orig = " + orig + ", test = " + test );
               }
               return ( orig == test );
               //return ( m_key.equals( ( ( JISPKey ) obj ).m_key ) );
  @@ -196,22 +195,11 @@
       public int hashCode()
       {
           int hash = m_key.hashCode();
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "hash = " + hash );
  +            log.debug( "hash = " + hash );
           }
           return hash;
           // new Integer(m_key).hashCode();
       }
  -
  -    /**
  -     *  Easy debugging printing
  -     *
  -     *@param  s  Stirng to print
  -     */
  -    public void p( String s )
  -    {
  -        System.out.println( "JISPKey: " + s );
  -    }
  -
   }
  
  
  
  1.4       +1 -2      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPLockManager.java
  
  Index: JISPLockManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPLockManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JISPLockManager.java	15 Jan 2002 21:33:30 -0000	1.3
  +++ JISPLockManager.java	15 Feb 2002 04:33:35 -0000	1.4
  @@ -12,7 +12,7 @@
    */
   class JISPLockManager extends ReadWriteLockManager
   {
  -
  +    
       /**
        *@TODO    might need to have this lock for only one cache at a time might
        *      want to lock on a Diskcache instance
  @@ -20,7 +20,6 @@
       public final static String Disk = "Disk";
       private static JISPLockManager instance;
   
  -    boolean debug = false;
       private final Hashtable ht = new Hashtable();
   
   
  
  
  
  1.7       +20 -61    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCache.java
  
  Index: LateralCache.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCache.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LateralCache.java	18 Jan 2002 21:53:47 -0000	1.6
  +++ LateralCache.java	15 Feb 2002 04:33:36 -0000	1.7
  @@ -15,8 +15,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   import org.apache.stratum.jcs.engine.behavior.ICacheType;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   import org.apache.stratum.jcs.utils.reuse.IZombie;
   
  @@ -28,10 +28,9 @@
    */
   public class LateralCache implements ICache
   {
  -
  -    private static boolean debug = false;
  -    //true;
  -    private static Logger log;
  +    private static final Log log = 
  +        LogSource.getInstance( LateralCache.class );
  +    
       private static int numCreated = 0;
   
       Attributes attr = null;
  @@ -44,26 +43,11 @@
   
       final String cacheName;
   
  -    private String source_id = "org.apache.stratum.jcs.auxiliary.lateral.LateralCache";
  -
       /**
        *  either http, socket.udp, or socket.tcp can set in config
        */
       private ILateralCacheService lateral;
   
  -
  -    ///////////////////////////////////////////////////
  -    /**
  -     *  Gets the sourceId attribute of the LateralCache object
  -     *
  -     *@return    The sourceId value
  -     */
  -    public Serializable getSourceId()
  -    {
  -        return this.source_id;
  -    }
  -
  -
       ////////////////////////////////////////////////////////
       /**
        *  Constructor for the LateralCache object
  @@ -73,16 +57,9 @@
        */
       protected LateralCache( ILateralCacheAttributes cattr, ILateralCacheService lateral )
       {
  -
           this.cacheName = cattr.getCacheName();
           this.cattr = cattr;
           this.lateral = lateral;
  -        log = LoggerManager.getLogger( this );
  -
  -        if ( debug )
  -        {
  -            p( "Construct> cacheName=" + cacheName + ", lateral =  " + lateral );
  -        }
       }
   
   
  @@ -94,17 +71,10 @@
        */
       protected LateralCache( ILateralCacheAttributes cattr )
       {
  -
           this.cacheName = cattr.getCacheName();
           //this.servers = servers;
   
           this.cattr = cattr;
  -        log = LoggerManager.getLogger( this );
  -
  -        if ( debug )
  -        {
  -            p( "Construct> cacheName=" + cattr.getCacheName() );
  -        }
       }
   
   
  @@ -170,18 +140,17 @@
       {
           try
           {
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "lateral = " + lateral );
  -                //p( "ce = " + ce );
  -                p( "LateralCacheInfo.listenerId = " + LateralCacheInfo.listenerId );
  +                log.debug( "update: lateral = " + lateral +", " +
  +                           "LateralCacheInfo.listenerId = " + 
  +                           LateralCacheInfo.listenerId );
               }
               lateral.update( ce, LateralCacheInfo.listenerId );
           }
           catch ( NullPointerException npe )
           {
  -            //log.error( npe, "npe for ce = " + ce + "ce.attr = " + ce.getAttributes() );
  -            log.error( npe );
  +            log.error( "Failure updating lateral", npe );
               return;
           }
           catch ( Exception ex )
  @@ -259,10 +228,8 @@
       public boolean remove( Serializable key )
           throws IOException
       {
  -        if ( debug )
  -        {
  -            p( "remove> key=" + key );
  -        }
  +        log.debug( "removing key:" + key );
  +        
           try
           {
               //DeleteLateralCacheMulticaster dlcm = new DeleteLateralCacheMulticaster( cattr.getCacheName(), (String)key, cattr.getLateralCacheAddrs(), cattr.getLateralDeleteServlet()  );
  @@ -307,7 +274,8 @@
       public void dispose()
           throws IOException
       {
  -        p( "disposing of lateral cache" );
  +        log.debug( "Disposing of lateral cache" );
  +        
           ///* HELP: This section did nothing but generate compilation warnings.
           // TODO: may limit this funcionality. It is dangerous.
           // asmuts -- Added functionality to help with warnings.  I'm not getting any.
  @@ -318,7 +286,7 @@
           }
           catch ( Exception ex )
           {
  -            p( "couldn't dispose" );
  +            log.error( "Couldn't dispose", ex );
               handleException( ex, "Failed to dispose " + cattr.getCacheName() );
           }
           //*/
  @@ -392,8 +360,8 @@
           throws IOException
       {
   
  -        log.error( "Disabling lateral cache due to error " + msg );
  -        log.error( ex );
  +        log.error( "Disabling lateral cache due to error " + msg, ex );
  +        
           lateral = new ZombieLateralCacheService();
           // may want to flush if region specifies
           // Notify the cache monitor about the error, and kick off the recovery process.
  @@ -418,18 +386,9 @@
           this.lateral = lateral;
           return;
       }
  -
  -
  -    /////////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  +    
  +    public Serializable getSourceId()
       {
  -        //log.debug("LateralCache:" + s);
  -        System.out.println( "LateralCache:" + s );
  +        return LateralCache.class.getName();
       }
  -
   }
  
  
  
  1.4       +4 -18     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCacheFactory.java
  
  Index: LateralCacheFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCacheFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LateralCacheFactory.java	15 Jan 2002 21:33:30 -0000	1.3
  +++ LateralCacheFactory.java	15 Feb 2002 04:33:36 -0000	1.4
  @@ -9,8 +9,8 @@
   
   import org.apache.stratum.jcs.engine.behavior.ICache;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   //import org.apache.stratum.jcs.auxiliary.*;
   
  @@ -26,8 +26,8 @@
    */
   public class LateralCacheFactory implements IAuxiliaryCacheFactory
   {
  -
  -    private static Logger log = LoggerManager.getLogger( LateralCacheFactory.class );
  +    private static final Log log = 
  +        LogSource.getInstance( LateralCacheFactory.class );
   
       private static String name;
   
  @@ -127,18 +127,4 @@
       {
           this.name = name;
       }
  -
  -
  -    ///////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p( String s )
  -    {
  -        System.out.println( "LateralCacheFactory: " + s );
  -    }
  -
   }
  -// end class
  
  
  
  1.5       +55 -108   jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCacheManager.java
  
  Index: LateralCacheManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCacheManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LateralCacheManager.java	18 Jan 2002 21:53:47 -0000	1.4
  +++ LateralCacheManager.java	15 Feb 2002 04:33:36 -0000	1.5
  @@ -31,35 +31,34 @@
   import org.apache.stratum.jcs.engine.behavior.ICache;
   import org.apache.stratum.jcs.engine.behavior.ICacheAttributes;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   //import  org.apache.stratum.jcs.auxiliary.*;
   //import  org.apache.stratum.jcs.auxiliary.lateral.http.*;
   
  -
   /**
  - *  Creates lateral caches. Lateral caches are primarily used for removing non
  - *  laterally configured caches. Non laterally configured cache regions should
  - *  still bea ble to participate in removal. But if there is a non laterally
  - *  configured cache hub, then lateral removals may be necessary. For flat
  - *  webserver production environments, without a strong machine at the app
  - *  server level, distribution and search may need to occur at the lateral cache
  - *  level. This is currently not implemented in the lateral cache.
  + * Creates lateral caches. Lateral caches are primarily used for removing non
  + * laterally configured caches. Non laterally configured cache regions should
  + * still bea ble to participate in removal. But if there is a non laterally
  + * configured cache hub, then lateral removals may be necessary. For flat
  + * webserver production environments, without a strong machine at the app
  + * server level, distribution and search may need to occur at the lateral cache
  + * level. This is currently not implemented in the lateral cache.
    *
  - *@author     asmuts
  - *@created    January 15, 2002
  + * TODO:
  + *   - need freeCache, release, getStats
  + *   - need to find an interface acceptible for all
  + *   - cache managers or a manager within a type
    */
   public class LateralCacheManager implements IAuxiliaryCacheManager
   {
  -
  -    private static boolean debug = true;
  -    //false;
  +    private static final Log log = 
  +        LogSource.getInstance( LateralCacheManager.class );
   
       //static ArrayList defaultServers;
       ICacheAttributes defaultCattr;
   
  -    private static Logger log;
       private static LateralCacheMonitor monitor;
   
       final static Map instances = new HashMap();
  @@ -93,13 +92,11 @@
        */
       public static LateralCacheManager getInstance( ILateralCacheAttributes lca )
       {
  -        if ( debug )
  -        {
  -            p( "getting instance" );
  -        }
           LateralCacheManager ins = ( LateralCacheManager ) instances.get( lca.toString() );
           if ( ins == null )
           {
  +            log.debug( "Instance is null, creating" );
  +            
               synchronized ( instances )
               {
                   ins = ( LateralCacheManager ) instances.get( lca.toString() );
  @@ -110,17 +107,7 @@
                   }
               }
           }
  -        else
  -        {
  -            if ( debug )
  -            {
  -                ins.p( "found manager already created" );
  -            }
  -        }
  -        if ( debug )
  -        {
  -            ins.log.logIt( "Manager stats : " + ins.getStats() + "<br> -- in getInstance()" );
  -        }
  +
           ins.clients++;
           // Fires up the monitoring daemon.
           if ( monitor == null )
  @@ -136,9 +123,7 @@
           }
           return ins;
       }
  -    // end getInstance
   
  -    ////////////////////////////////////////////////////////
       /**
        *  Constructor for the LateralCacheManager object
        *
  @@ -147,52 +132,49 @@
       private LateralCacheManager( ILateralCacheAttributes lca )
       {
           this.lca = lca;
  -        log = LoggerManager.getLogger( this );
  -        if ( debug )
  +        
  +        if ( log.isDebugEnabled() )
           {
  -            p( "creating lateral cache service lca = " + lca );
  +            log.debug( "Creating lateral cache service, lca = " + lca );
           }
  +        
           // need to create the service based on the type
  -        // ex
  +
           try
           {
               if ( lca.getTransmissionType() == lca.UDP )
               {
                   // need to allow for this to be a service.
                   // should wrap sender and new kind of receiver?
  -                if ( debug )
  -                {
  -                    p( "udp service" );
  -                }
  +
  +                log.debug( "Creating UDP service" );
  +                
                   this.lateralService = new LateralUDPService( lca );
               }
  -            else
  -                if ( lca.getTransmissionType() == lca.HTTP )
  +            else if ( lca.getTransmissionType() == lca.HTTP )
               {
  -                if ( debug )
  -                {
  -                    p( "http service" );
  -                }
  +                log.debug( "[NOT] Creating HTTP service" );
  +                
  +                // FIXME: Why is this disabled?
                   //this.lateralService = new LateralHTTPService( lca );
               }
  -            else
  -                if ( lca.getTransmissionType() == lca.TCP )
  +            else if ( lca.getTransmissionType() == lca.TCP )
               {
  -                if ( debug )
  -                {
  -                    p( "tcp service" );
  -                }
  +                log.debug( "Creating TCP service" );
  +                
                   this.lateralService = new LateralTCPService( lca );
               }
               else
               {
  -                log.error( "type not recognized, must zombie" );
  +                log.error( "Type not recognized, must zombie" );
  +                
                   throw new Exception( "no known transmission type for lateral cache." );
               }
   
               if ( this.lateralService == null )
               {
  -                log.error( "no service created?, must zombie" );
  +                log.error( "No service created, must zombie" );
  +                
                   throw new Exception( "no service created for lateral cache." );
               }
   
  @@ -203,25 +185,23 @@
           catch ( Exception ex )
           {
               // Failed to connect to the lateral server.
  -            // Configure this LateralCacheManager instance to use the "zombie" services.
  -            log.error( ex.toString() + "**********************ZOMBIZING LATERAL SERVICE" );
  +            // Configure this LateralCacheManager instance to use the 
  +            // "zombie" services.
  +            
  +            log.error( "Failure, lateral instance will use zombie service", ex );
  +            
               lateralService = new ZombieLateralCacheService();
               lateralWatch = new LateralCacheWatchRepairable();
               lateralWatch.setCacheWatch( new ZombieLateralCacheWatch() );
  -            // Notify the cache monitor about the error, and kick off the recovery process.
  +            
  +            // Notify the cache monitor about the error, and kick off 
  +            // the recovery process.
               LateralCacheMonitor.getInstance().notifyError();
           }
       }
  -    // end constructor
   
       /**
        *  Adds the lateral cache listener to the underlying cache-watch service.
  -     *
  -     *@param  cacheName        The feature to be added to the
  -     *      LateralCacheListener attribute
  -     *@param  listener         The feature to be added to the
  -     *      LateralCacheListener attribute
  -     *@exception  IOException  Description of the Exception
        */
       public void addLateralCacheListener( String cacheName, ILateralCacheListener listener )
           throws IOException
  @@ -230,17 +210,12 @@
           {
               lateralWatch.addCacheListener( cacheName, listener );
           }
  -        return;
       }
   
  -
       /**
        *  Called to access a precreated region or construct one with defaults.
        *  Since all aux cache access goes through the manager, this will never be
        *  called.
  -     *
  -     *@param  cacheName  Description of the Parameter
  -     *@return            The cache value
        */
       public ICache getCache( String cacheName )
       {
  @@ -278,31 +253,24 @@
               log.error( e );
           }
   
  -        if ( log.logLevel >= log.DEBUG )
  -        {
  -            //log.debug("LateralManager stats : " + getStats());
  -        }
  +        // if ( log.isDebugEnabled() )
  +        // {
  +        //     log.debug("LateralManager stats : " + getStats());
  +        // }
  +        
           return c;
       }
   
  -
  -    //////////////////////////////////////////////
       /**
  -     *  Gets the cacheType attribute of the LateralCacheManager object
  -     *
  -     *@return    The cacheType value
  +     * Gets the cacheType attribute of the LateralCacheManager object
        */
       public int getCacheType()
       {
           return LATERAL_CACHE;
       }
   
  -
  -    //////////////////////////////////////
       /**
  -     *  Gets the stats attribute of the LateralCacheManager object
  -     *
  -     *@return    The stats value
  +     * Gets the stats attribute of the LateralCacheManager object
        */
       public String getStats()
       {
  @@ -310,16 +278,13 @@
           return "";
       }
   
  -
       /**
  -     *  Fixes up all the caches managed by this cache manager.
  -     *
  -     *@param  lateralService  Description of the Parameter
  -     *@param  lateralWatch    Description of the Parameter
  +     * Fixes up all the caches managed by this cache manager.
        */
       public void fixCaches( ILateralCacheService lateralService, ILateralCacheObserver lateralWatch )
       {
  -        p( "*******FIXING LATERAL CACHE*********" );
  +        log.debug( "Fixing lateral caches:" );
  +        
           synchronized ( caches )
           {
               this.lateralService = lateralService;
  @@ -332,22 +297,4 @@
               }
           }
       }
  -
  -
  -    /////////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p( String s )
  -    {
  -        System.out.println( "LateralCacheManager:" + s );
  -    }
  -
  -    ////////////////////////////////////////////////
  -    // need freeCache, release, getStats
  -    // need to find an interface acceptible for all
  -    // cache managers or a manager within a type
  -
   }
  
  
  
  1.4       +14 -34    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCacheMonitor.java
  
  Index: LateralCacheMonitor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCacheMonitor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LateralCacheMonitor.java	15 Jan 2002 21:33:30 -0000	1.3
  +++ LateralCacheMonitor.java	15 Feb 2002 04:33:36 -0000	1.4
  @@ -6,8 +6,8 @@
   import org.apache.stratum.jcs.auxiliary.lateral.LateralCacheNoWait;
   import org.apache.stratum.jcs.auxiliary.lateral.LateralCacheRestore;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Used to monitor and repair any failed connection for the lateral cache
  @@ -23,17 +23,13 @@
    */
   public class LateralCacheMonitor implements Runnable
   {
  +    private static final Log log = 
  +        LogSource.getInstance( LateralCacheManager.class );
   
  -    /**
  -     *  Description of the Field
  -     */
  -    protected final static boolean debug = true;
  -    //false;
       private static LateralCacheMonitor instance;
       private static long idlePeriod = 20 * 1000;
       // minimum 20 seconds.
       //private static long idlePeriod = 3*1000; // for debugging.
  -    private transient Logger log = LoggerManager.getInstance().getLogger( this );
   
       // Must make sure LateralCacheMonitor is started before any lateral error can be detected!
       private boolean alright = true;
  @@ -99,7 +95,7 @@
       // If exception is thrown owing to synchronization,
       // just skip the monitoring until the next round.
       /**
  -     *  Main processing method for the LateralCacheMonitor object
  +     * Main processing method for the LateralCacheMonitor object
        */
       public void run()
       {
  @@ -126,10 +122,11 @@
               // Time driven mode: sleep between each round of recovery attempt.
               try
               {
  -                if ( debug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "cache monitor sleeping for " + idlePeriod );
  +                    log.debug( "cache monitor sleeping for " + idlePeriod );
                   }
  +                
                   Thread.currentThread().sleep( idlePeriod );
               }
               catch ( InterruptedException ex )
  @@ -142,10 +139,9 @@
               {
                   alright = true;
               }
  -            if ( debug )
  -            {
  -                p( "cache monitor running." );
  -            }
  +            
  +            log.debug( "cache monitor running." );
  +
               // Monitor each LateralCacheManager instance one after the other.
               // Each LateralCacheManager corresponds to one lateral connection.
               for ( Iterator itr = LateralCacheManager.instances.values().iterator(); itr.hasNext();  )
  @@ -162,10 +158,8 @@
                               LateralCacheNoWait c = ( LateralCacheNoWait ) itr2.next();
                               if ( c.getStatus() == c.STATUS_ERROR )
                               {
  -                                if ( debug )
  -                                {
  -                                    p( "found LateralCacheNoWait in error" );
  -                                }
  +                                log.debug( "found LateralCacheNoWait in error" );
  +                                
                                   LateralCacheRestore repairer = new LateralCacheRestore( mgr );
                                   // If we can't fix them, just skip and re-try in the next round.
                                   if ( repairer.canFix() )
  @@ -180,10 +174,7 @@
                               }
                               else
                               {
  -                                if ( debug )
  -                                {
  -                                    p( "lcnw not in error" );
  -                                }
  +                                log.debug( "lcnw not in error" );
                               }
                           }
                       }
  @@ -212,17 +203,6 @@
                   alright = false;
               }
           }
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        System.out.println( "LateralCacheMonitor:" + s );
       }
   }
   
  
  
  
  1.4       +10 -29    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCacheNoWait.java
  
  Index: LateralCacheNoWait.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCacheNoWait.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LateralCacheNoWait.java	15 Jan 2002 21:33:30 -0000	1.3
  +++ LateralCacheNoWait.java	15 Feb 2002 04:33:36 -0000	1.4
  @@ -16,8 +16,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   import org.apache.stratum.jcs.engine.behavior.ICacheEventQueue;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   //import org.apache.stratum.jcs.auxiliary.lateral.socket.tcp.*;
   
  @@ -31,24 +31,11 @@
    */
   public class LateralCacheNoWait implements ICache
   {
  +    private static final Log log = 
  +        LogSource.getInstance( LateralCacheNoWait.class );
  +        
       private final LateralCache cache;
       private ICacheEventQueue q;
  -    private transient Logger log = LoggerManager.getInstance().getLogger( this );
  -
  -    private String source_id = "org.apache.stratum.jcs.auxiliary.lateral.LateralCacheNoWait";
  -
  -
  -    ///////////////////////////////////////////////////
  -    /**
  -     *  Gets the sourceId attribute of the LateralCacheNoWait object
  -     *
  -     *@return    The sourceId value
  -     */
  -    public Serializable getSourceId()
  -    {
  -        return this.source_id;
  -    }
  -
   
       /**
        *  Constructs with the given lateral cache, and fires up an event queue for
  @@ -159,14 +146,14 @@
           }
           catch ( UnmarshalException ue )
           {
  -            p( "Retrying the get owing to UnmarshalException..." );
  +            log.debug( "Retrying the get owing to UnmarshalException..." );
               try
               {
                   return cache.get( key );
               }
               catch ( IOException ex )
               {
  -                p( "Failed in retrying the get for the second time." );
  +                log.error( "Failed in retrying the get for the second time." );
                   q.destroy();
               }
           }
  @@ -327,15 +314,9 @@
       {
           return "LateralCacheNoWait: " + cache.toString();
       }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  +    
  +    public Serializable getSourceId()
       {
  -        System.out.println( "LateralCacheNoWait:" + s );
  +        return LateralCache.class.getName();
       }
   }
  
  
  
  1.6       +10 -25    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCacheNoWaitFacade.java
  
  Index: LateralCacheNoWaitFacade.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCacheNoWaitFacade.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LateralCacheNoWaitFacade.java	18 Jan 2002 21:53:47 -0000	1.5
  +++ LateralCacheNoWaitFacade.java	15 Feb 2002 04:33:36 -0000	1.6
  @@ -10,8 +10,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICacheType;
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   //import org.apache.stratum.jcs.auxiliary.lateral.socket.tcp.*;
   
  @@ -27,14 +27,11 @@
    */
   public class LateralCacheNoWaitFacade implements ICache
   {
  +    private static final Log log = 
  +        LogSource.getInstance( LateralCacheNoWaitFacade.class );
   
  -    private final static boolean debug = false;//true;
  -
  -    /**
  -     *  Description of the Field
  -     */
       public LateralCacheNoWait[] noWaits;
  -    private transient Logger log = LoggerManager.getInstance().getLogger( this );
  +    
       private String source_id = "org.apache.stratum.jcs.auxiliary.lateral.LateralCacheNoWaitFacade";
   
       private String cacheName;
  @@ -113,9 +110,9 @@
       public void update( ICacheElement ce )
           throws IOException
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "updating through lateral cache facade, noWaits.length = " + noWaits.length );
  +            log.debug( "updating through lateral cache facade, noWaits.length = " + noWaits.length );
           }
           try
           {
  @@ -157,9 +154,9 @@
               try
               {
                   Object obj = noWaits[i].get( key, container );
  -                if ( debug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "obj = " + obj );
  +                    log.debug( "obj = " + obj );
                   }
                   if ( obj != null )
                   {
  @@ -171,8 +168,7 @@
               }
               catch ( Exception ex )
               {
  -                log.error( ex );
  -                p( "Failed to get." );
  +                log.error( "Failed to get", ex );
               }
               return null;
           }
  @@ -311,16 +307,5 @@
       public String toString()
       {
           return "LateralCacheNoWaitFacade: " + cacheName;
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        System.out.println( "LateralCacheNoWaitFacade:" + s );
       }
   }
  
  
  
  1.4       +5 -18     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCacheRestore.java
  
  Index: LateralCacheRestore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/LateralCacheRestore.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LateralCacheRestore.java	15 Jan 2002 21:33:30 -0000	1.3
  +++ LateralCacheRestore.java	15 Feb 2002 04:33:36 -0000	1.4
  @@ -9,8 +9,8 @@
   
   import org.apache.stratum.jcs.engine.behavior.ICacheRestore;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Used to repair the lateral caches managed by the associated instance of
  @@ -21,10 +21,9 @@
    */
   public class LateralCacheRestore implements ICacheRestore
   {
  +    private static final Log log = 
  +        LogSource.getInstance( LateralCacheRestore.class );
   
  -    private Logger log = LoggerManager.getLogger( this );
  -
  -    private boolean debug = true;
       private final LateralCacheManager lcm;
       private boolean canFix = true;
   
  @@ -96,18 +95,6 @@
           lcm.fixCaches( ( ILateralCacheService ) lateralObj, ( ILateralCacheObserver ) lateralObj );
           String msg = "Lateral connection resumed.";
           log.info( msg );
  -        p( msg );
  -    }
  -
  -
  -    ////////////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        System.out.println( "LateralCacheRestore:" + s );
  +        log.debug( msg );
       }
   }
  
  
  
  1.5       +6 -12     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/http/broadcast/LateralCacheMulticaster.java
  
  Index: LateralCacheMulticaster.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/http/broadcast/LateralCacheMulticaster.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LateralCacheMulticaster.java	16 Jan 2002 17:04:47 -0000	1.4
  +++ LateralCacheMulticaster.java	15 Feb 2002 04:33:36 -0000	1.5
  @@ -7,8 +7,8 @@
   
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   import org.apache.stratum.jcs.utils.reuse.ThreadPoolManager;
   
  @@ -23,15 +23,12 @@
    */
   public class LateralCacheMulticaster
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( LateralCacheMulticaster.class );
  +    
       private final static String servlet = "/cache/cache/LateralCacheServletReceiver";
       private final ICacheElement ice;
       private final ArrayList servers;
  -    /**
  -     *  Description of the Field
  -     */
  -    protected Logger log;
  -
   
       ////////////////////////////////////////////////////////////////////////
       /**
  @@ -42,13 +39,10 @@
        */
       public LateralCacheMulticaster( ICacheElement ice, ArrayList servers )
       {
  -
           this.servers = servers;
           this.ice = ice;
   
  -        LoggerManager loggerMgr = LoggerManager.getInstance();
  -        log = loggerMgr.getLogger( this );
  -        if ( log.logLevel >= log.DEBUG )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "In DistCacheMulticaster" );
           }
  
  
  
  1.4       +32 -62    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/http/broadcast/LateralCacheThread.java
  
  Index: LateralCacheThread.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/http/broadcast/LateralCacheThread.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LateralCacheThread.java	15 Jan 2002 21:33:31 -0000	1.3
  +++ LateralCacheThread.java	15 Feb 2002 04:33:36 -0000	1.4
  @@ -15,8 +15,8 @@
   
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   ////////////////////////////////////////////////////////////////////////
   /**
  @@ -26,40 +26,21 @@
    */
   public class LateralCacheThread extends Thread
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( LateralCacheThread.class );
  +        
       private final static String servlet = "/rcash/ramraf/DistCacheServlet";
  -    /**
  -     *  Description of the Field
  -     */
  +
       protected String hashtableName;
  -    /**
  -     *  Description of the Field
  -     */
  +
       protected String key;
  -    /**
  -     *  Description of the Field
  -     */
  +
       protected Serializable val;
  -    /**
  -     *  Description of the Field
  -     */
  -    protected boolean debug = false;
  -    //true;
  -    /**
  -     *  Description of the Field
  -     */
  +    
       protected boolean running = true;
  -    /**
  -     *  Description of the Field
  -     */
  -    protected Logger log;
  -    /**
  -     *  Description of the Field
  -     */
  +    
       protected String[] servers;
   
  -
  -    ////////////////////////////////////////////////////////////////////////
       /**
        *  Constructor for the LateralCacheThread object
        *
  @@ -74,9 +55,6 @@
           this.key = key;
           this.val = val;
           this.servers = servers;
  -        LoggerManager loggerMgr = LoggerManager.getInstance();
  -        log = loggerMgr.getLogger( this );
  -        log.debug( "In DistCacheThread" );
       }
   
   
  @@ -97,8 +75,7 @@
               running = false;
               long end = System.currentTimeMillis();
               log.info( "transfer took " + String.valueOf( end - start ) + " millis" );
  -            log.flush();
  -            log = null;
  +
               return;
               //}
           }
  @@ -125,33 +102,35 @@
           {
               for ( int i = 0; i < servers.length; i++ )
               {
  -                if ( debug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    log.logIt( "servers[i] + servlet = " + servers[i] + servlet );
  +                    log.debug( "servers[i] + servlet = " + servers[i] + servlet );
                   }
                   // create our URL
                   URL tmpURL = new URL( servers[i] + servlet );
                   URL url = new URL( tmpURL.toExternalForm() );
  -                if ( debug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    log.logIt( "tmpURL = " + tmpURL );
  +                    log.debug( "tmpURL = " + tmpURL );
                   }
   
                   // Open our URLConnection
  -                if ( debug )
  -                {
  -                    log.logIt( "Opening Connection." );
  -                }
  +
  +                log.debug( "Opening Connection." );
  +                
                   URLConnection con = url.openConnection();
  -                if ( debug )
  +                
  +                if ( log.isDebugEnabled() )
                   {
  -                    log.logIt( "con = " + con );
  +                    log.debug( "con = " + con );
                   }
  +                
                   writeObj( con, cb );
                   response = read( con );
  -                if ( debug )
  +                
  +                if ( log.isDebugEnabled() )
                   {
  -                    log.logIt( "response = " + response );
  +                    log.debug( "response = " + response );
                   }
               }
               // end for
  @@ -193,16 +172,13 @@
               log.debug( "os = " + os );
   
               // Write the ICacheItem to the ObjectOutputStream
  -            if ( debug )
  -            {
  -                log.logIt( "Writing  ICacheItem." );
  -            }
  +            log.debug( "Writing  ICacheItem." );
  +            
               os.writeObject( cb );
               os.flush();
  -            if ( debug )
  -            {
  -                log.logIt( "closing output stream" );
  -            }
  +            
  +            log.debug( "closing output stream" );
  +            
               os.close();
           }
           catch ( IOException e )
  @@ -228,11 +204,8 @@
               ObjectInputStream is = new ObjectInputStream( connection.getInputStream() );
               result = ( String ) is.readObject();
               is.close();
  -            if ( debug )
  -            {
  -                //System.out.println("got result.");
  -            }
  -            log.logIt( "got result = " + result );
  +
  +            log.debug( "got result = " + result );
           }
           catch ( IOException e )
           {
  @@ -244,7 +217,4 @@
           }
           return result;
       }
  -    // end read
  -
   }
  -// end class
  
  
  
  1.4       +29 -41    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/http/broadcast/LateralCacheUnicaster.java
  
  Index: LateralCacheUnicaster.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/http/broadcast/LateralCacheUnicaster.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LateralCacheUnicaster.java	15 Jan 2002 21:33:31 -0000	1.3
  +++ LateralCacheUnicaster.java	15 Feb 2002 04:33:36 -0000	1.4
  @@ -13,8 +13,8 @@
   
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   import org.apache.stratum.jcs.utils.reuse.IThreadPoolRunnable;
   
  @@ -24,19 +24,16 @@
    *@author     asmuts
    *@created    January 15, 2002
    */
  -public class LateralCacheUnicaster implements IThreadPoolRunnable
  +public class LateralCacheUnicaster 
  +    implements IThreadPoolRunnable
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( LateralCacheUnicaster.class );
  +    
       private final ICacheElement item;
       private final String urlStr;
  -    private final Logger log;
   
       private URLConnection conn;
  -    /**
  -     *  Description of the Field
  -     */
  -    protected boolean debug = false;
  -
   
       /**
        *  Constructs with the given ICacheItem and the url of the target server.
  @@ -48,7 +45,7 @@
       {
           this.item = item;
           this.urlStr = urlStr;
  -        log = LoggerManager.getInstance().getLogger( this );
  +        
           log.debug( "In LateralCacheUnicaster2, " + Thread.currentThread().getName() );
       }
   
  @@ -79,33 +76,32 @@
   
           try
           {
  -            if ( debug )
  -            {
  -                log.logIt( "url = " + urlStr );
  -            }
  +            log.debug( "url = " + urlStr );
  +            
               // create our URL
               URL tmpURL = new URL( urlStr );
               URL url = new URL( tmpURL.toExternalForm() );
  -            if ( debug )
  -            {
  -                log.logIt( "tmpURL = " + tmpURL );
  -            }
  +
  +            log.debug( "tmpURL = " + tmpURL );
   
               // Open our URLConnection
  -            if ( debug )
  -            {
  -                log.logIt( "Opening Connection." );
  -            }
  +            
  +            log.debug( "Opening Connection." );
  +            
               conn = url.openConnection();
  -            if ( log.logLevel >= log.DEBUG )
  +            
  +            if ( log.isDebugEnabled() )
               {
                   log.debug( "conn = " + conn );
               }
  +            
               String response = sendCacheItem();
  -            if ( log.logLevel >= log.DEBUG )
  +            
  +            if ( log.isDebugEnabled() )
               {
                   log.debug( "response = " + response );
               }
  +            
               conn = null;
           }
           catch ( MalformedURLException mue )
  @@ -120,16 +116,14 @@
           {
               log.warn( "ioe - Unicaster couldn't connect to " + urlStr );
           }
  -        // end catch
   
  -        if ( log.logLevel >= log.DEBUG )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "transfer took " + String.valueOf( System.currentTimeMillis() - start ) + " millis\n" );
           }
  -        log.flush();
  +
           return;
       }
  -    // end send cache
   
       /**
        *  Sends the ICacheItem to the current URLConnection.
  @@ -150,10 +144,9 @@
                   log.debug( "os = " + os );
   
                   // Write the ICacheItem to the ObjectOutputStream
  -                if ( debug )
  -                {
  -                    log.logIt( "Writing ICacheItem." );
  -                }
  +
  +                log.debug( "Writing ICacheItem." );
  +
                   os.writeObject( item );
               }
               finally
  @@ -166,12 +159,10 @@
           {
               log.warn( "ie - couldn't send item " + urlStr );
           }
  -        // end catch
  +
           return "";
       }
   
  -
  -    ////////////////////////////////////////////////////////
       /**
        *  Gets the response attribute of the LateralCacheUnicaster object
        *
  @@ -193,7 +184,7 @@
               {
                   is.close();
               }
  -            if ( log.logLevel >= log.DEBUG )
  +            if ( log.isDebugEnabled() )
               {
                   log.debug( "got result = " + result );
               }
  @@ -208,7 +199,4 @@
           }
           return result;
       }
  -    // end getResponse
  -
  -}
  -// end class
  +}
  \ No newline at end of file
  
  
  
  1.5       +6 -30     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/http/remove/DeleteLateralCacheMulticaster.java
  
  Index: DeleteLateralCacheMulticaster.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/http/remove/DeleteLateralCacheMulticaster.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DeleteLateralCacheMulticaster.java	16 Jan 2002 17:04:47 -0000	1.4
  +++ DeleteLateralCacheMulticaster.java	15 Feb 2002 04:33:36 -0000	1.5
  @@ -5,8 +5,8 @@
   
   import org.apache.stratum.jcs.auxiliary.lateral.http.remove.DeleteLateralCacheUnicaster;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   import org.apache.stratum.jcs.utils.reuse.ThreadPoolManager;
   
  @@ -21,7 +21,9 @@
    */
   public class DeleteLateralCacheMulticaster
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( DeleteLateralCacheMulticaster.class );
  +    
       // must get servletName from the props file
       private final String servlet;
   
  @@ -31,13 +33,6 @@
       private final ArrayList servers;
   
       /**
  -     *  Description of the Field
  -     */
  -    protected Logger log;
  -
  -
  -    ////////////////////////////////////////////////////////////////////////
  -    /**
        *  Constructor for the DeleteLateralCacheMulticaster object
        *
        *@param  hashtableName  Description of the Parameter
  @@ -47,16 +42,12 @@
        */
       public DeleteLateralCacheMulticaster( String hashtableName, String key, ArrayList servers, String servlet )
       {
  -
           this.hashtableName = hashtableName;
           this.key = key;
           this.servers = servers;
           this.servlet = servlet;
   
  -        LoggerManager loggerMgr = LoggerManager.getInstance();
  -        log = loggerMgr.getLogger( this );
  -        log.setLogLevel( log.DEBUG );
  -        if ( log.logLevel >= log.DEBUG )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "In DistCacheMulticaster" );
           }
  @@ -80,21 +71,6 @@
           }
           return;
       }
  -    // end multicast
  -
  -    ////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    public static void p( String s )
  -    {
  -        System.out.println( s );
  -        //log.debug( s );
  -    }
  -
   }
  -// end class
   
   
  
  
  
  1.4       +10 -32    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/http/remove/DeleteLateralCacheUnicaster.java
  
  Index: DeleteLateralCacheUnicaster.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/http/remove/DeleteLateralCacheUnicaster.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DeleteLateralCacheUnicaster.java	15 Jan 2002 21:33:31 -0000	1.3
  +++ DeleteLateralCacheUnicaster.java	15 Feb 2002 04:33:36 -0000	1.4
  @@ -6,8 +6,8 @@
   import java.net.URL;
   import java.net.URLConnection;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   import org.apache.stratum.jcs.utils.reuse.IThreadPoolRunnable;
   
  @@ -19,19 +19,15 @@
    */
   public class DeleteLateralCacheUnicaster implements IThreadPoolRunnable
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( DeleteLateralCacheUnicaster.class );
  +    
       private final String hashtableName;
       private final String key;
   
       private String urlStr;
  -    private final Logger log;
   
       private URLConnection conn;
  -    /**
  -     *  Description of the Field
  -     */
  -    protected boolean debug = true;
  -
   
       /**
        *  Constructs with the given ICacheItem and the url of the target server.
  @@ -48,7 +44,6 @@
   
           this.urlStr = urlStr;
   
  -        log = LoggerManager.getLogger( this );
           log.debug( "In DeleteLateralCacheUnicaster, " + Thread.currentThread().getName() );
       }
   
  @@ -94,17 +89,15 @@
           {
               log.error( e );
           }
  -        // end catch
  -        if ( log.logLevel >= log.DEBUG )
  +        
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "delete took " + String.valueOf( System.currentTimeMillis() - start ) + " millis\n" );
           }
  -        log.flush();
  +
           return;
       }
  -    // end runIt
  -
  -    ///////////////////////////////////////////////
  +    
       /**
        *  Description of the Method
        *
  @@ -136,7 +129,7 @@
           }
           catch ( Exception e )
           {
  -            log.logEx( e );
  +            log.error( e );
           }
           finally
           {
  @@ -149,19 +142,4 @@
               return;
           }
       }
  -    // end callClearCache
  -
  -    ////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    public static void p( String s )
  -    {
  -        System.out.println( s );
  -        //log.debug( s );
  -    }
  -
   }
  -// end class
  
  
  
  1.4       +15 -20    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/http/server/AbstractDeleteCacheServlet.java
  
  Index: AbstractDeleteCacheServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/http/server/AbstractDeleteCacheServlet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractDeleteCacheServlet.java	15 Jan 2002 21:33:31 -0000	1.3
  +++ AbstractDeleteCacheServlet.java	15 Feb 2002 04:33:36 -0000	1.4
  @@ -22,8 +22,8 @@
   
   import org.apache.stratum.jcs.engine.group.GroupCacheManager;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   import org.apache.stratum.jcs.utils.servlet.BasicHttpAuthenticator;
   
  @@ -33,15 +33,12 @@
    *@author     asmuts
    *@created    January 15, 2002
    */
  -public abstract class AbstractDeleteCacheServlet extends HttpServlet implements SingleThreadModel
  +public abstract class AbstractDeleteCacheServlet 
  +    extends HttpServlet implements SingleThreadModel
   {
  -    /**
  -     *  Description of the Field
  -     */
  -    protected Logger log;
  -    /**
  -     *  Description of the Field
  -     */
  +    private static final Log log = 
  +        LogSource.getInstance( AbstractDeleteCacheServlet.class );
  +    
       protected GroupCacheManager cacheMgr;
       private BasicHttpAuthenticator authenticator;
   
  @@ -55,8 +52,6 @@
       public void init( ServletConfig config )
           throws ServletException
       {
  -        log = LoggerManager.getLogger( this );
  -
           // subsclass must initialize the cacheMgr before here.
           authenticator = new BasicHttpAuthenticator( "jcs" );
           super.init( config );
  @@ -93,7 +88,7 @@
                   paramName = ( String ) e.nextElement();
                   paramValue = req.getParameter( paramName );
                   params.put( paramName, paramValue );
  -                if ( log.DEBUG <= log.logLevel )
  +                if ( log.isDebugEnabled() )
                   {
                       log.debug( paramName + "=" + paramValue );
                   }
  @@ -110,7 +105,7 @@
               if ( hashtableName != null )
               {
   
  -                if ( log.DEBUG <= log.logLevel )
  +                if ( log.isDebugEnabled() )
                   {
                       log.debug( "hashtableName = " + hashtableName );
                   }
  @@ -162,7 +157,7 @@
                               {
                                   cache.removeAll();
   
  -                                if ( log.DEBUG <= log.logLevel )
  +                                if ( log.isDebugEnabled() )
                                   {
                                       log.debug( "Removed all elements from " + hashtableName );
                                   }
  @@ -170,7 +165,7 @@
                               }
                               else
                               {
  -                                if ( log.DEBUG <= log.logLevel )
  +                                if ( log.isDebugEnabled() )
                                   {
                                       log.debug( "key = " + key );
                                   }
  @@ -182,7 +177,7 @@
                                       String temp = ( String ) toke.nextElement();
                                       cache.remove( key );
   
  -                                    if ( log.DEBUG <= log.logLevel )
  +                                    if ( log.isDebugEnabled() )
                                       {
                                           log.debug( "Removed " + temp + " from " + hashtableName );
                                       }
  @@ -243,7 +238,7 @@
           //CATCH EXCEPTIONS
           catch ( Exception e )
           {
  -            log.logEx( e );
  +            log.error( e );
               //log.logIt( "hashtableName = " + hashtableName );
               //log.logIt( "key = " + key );
           }
  @@ -255,7 +250,7 @@
               {
                   isRedirect = "N";
               }
  -            if ( log.DEBUG <= log.logLevel )
  +            if ( log.isDebugEnabled() )
               {
                   log.debug( "isRedirect = " + isRedirect );
               }
  @@ -263,7 +258,7 @@
               if ( isRedirect.equals( "Y" ) )
               {
                   url = ( String ) params.get( "url" );
  -                if ( log.DEBUG <= log.logLevel )
  +                if ( log.isDebugEnabled() )
                   {
                       log.debug( "url = " + url );
                   }
  
  
  
  1.4       +7 -7      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/http/server/DeleteCacheServlet.java
  
  Index: DeleteCacheServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/http/server/DeleteCacheServlet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DeleteCacheServlet.java	15 Jan 2002 21:33:31 -0000	1.3
  +++ DeleteCacheServlet.java	15 Feb 2002 04:33:36 -0000	1.4
  @@ -78,7 +78,7 @@
   //    HttpServletResponse res)
   //    throws ServletException, IOException {
   //
  -//    if ( debug ) {
  +//    if ( log.isDebugEnabled() ) {
   //      log.logIt( "The DeleteCacheServlet has been called.\n" );
   //    }
   //
  @@ -109,7 +109,7 @@
   //
   //      if ( hashtableName != null ) {
   //
  -//        if ( debug ) {
  +//        if ( log.isDebugEnabled() ) {
   //          log.logIt( "hashtableName = " + hashtableName );
   //        }
   //        out.println( "hashtableName = " + hashtableName );
  @@ -122,7 +122,7 @@
   //          if ( key.toUpperCase().equals("ALL") ) {
   //
   //            cache.removeAll();
  -//            if ( debug ) {
  +//            if ( log.isDebugEnabled() ) {
   //              log.logIt( "Removed all elements from " + hashtableName );
   //            }
   //            out.println( "key = " + key );
  @@ -130,7 +130,7 @@
   //
   //          } else {
   //
  -//            if ( debug ) {
  +//            if ( log.isDebugEnabled() ) {
   //              log.logIt( "key = " + key );
   //            }
   //            out.println( "key = " + key );
  @@ -150,7 +150,7 @@
   //              //cache.remove( key, cache.LATERAL_INVOKATION );
   //              //cache.remove( key, true );
   //              cache.remove( key );
  -//              if ( debug ) {
  +//              if ( log.isDebugEnabled() ) {
   //                log.logIt( "Removed " + temp + " from " + hashtableName );
   //              }
   //
  @@ -193,13 +193,13 @@
   //      if ( isRedirect == null ) {
   //        isRedirect = "N";
   //      }
  -//			if ( debug ) {
  +//			if ( log.isDebugEnabled() ) {
   //				log.logIt( "isRedirect = " + isRedirect );
   //			}
   //      String url;
   //			if ( isRedirect.equals("Y")) {
   //				url = (String)params.get( "url" );
  -//				if ( debug ) {
  +//				if ( log.isDebugEnabled() ) {
   //					log.logIt( "url = " + url );
   //				}
   //				res.sendRedirect( url );	// will not work if there's a previously sent header
  
  
  
  1.4       +26 -70    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/http/server/LateralCacheServletReciever.java
  
  Index: LateralCacheServletReciever.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/http/server/LateralCacheServletReciever.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LateralCacheServletReciever.java	15 Jan 2002 21:33:31 -0000	1.3
  +++ LateralCacheServletReciever.java	15 Feb 2002 04:33:36 -0000	1.4
  @@ -23,8 +23,8 @@
   import org.apache.stratum.jcs.engine.control.CacheManagerFactory;
   import org.apache.stratum.jcs.engine.control.CompositeCacheManager;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   ////////////////////////////////////////////////////////////////////////
   /**
  @@ -34,14 +34,11 @@
    */
   public class LateralCacheServletReciever extends HttpServlet
   {
  -
  -    boolean debug = true;
  -    Logger log;
  +    private static final Log log = 
  +        LogSource.getInstance( LateralCacheServletReciever.class );
  +    
       private static CompositeCacheManager cacheMgr;
   
  -
  -    //////////////////////////////////////////////////////////
  -    //Initialize global variables
       /**
        *  Description of the Method
        *
  @@ -51,26 +48,13 @@
       public void init( ServletConfig config )
           throws ServletException
       {
  -
  -        LoggerManager loggerMgr = LoggerManager.getInstance();
  -        log = loggerMgr.getLogger( this );
           cacheMgr = CacheManagerFactory.getInstance();
   
           super.init( config );
  -
       }
  -    // end init
   
  -
  -    /////////////////////////////////////////////////////////////
  -    //SERVICE THE REQUEST
       /**
  -     *  Description of the Method
  -     *
  -     *@param  request               Description of the Parameter
  -     *@param  response              Description of the Parameter
  -     *@exception  ServletException  Description of the Exception
  -     *@exception  IOException       Description of the Exception
  +     * SERVICE THE REQUEST
        */
       public void service( HttpServletRequest request,
                            HttpServletResponse response )
  @@ -82,7 +66,7 @@
           if ( cacheMgr == null )
           {
               cacheMgr = CacheManagerFactory.getInstance();
  -            log.logIt( "cacheMgr was null in LateralCacheServlet" );
  +            log.debug( "cacheMgr was null in LateralCacheServlet" );
           }
   
           ICacheElement item = null;
  @@ -102,32 +86,23 @@
               ois.close();
   
           }
  -        //CATCH EXCEPTIONS
  -        catch ( ClassNotFoundException cnfe )
  -        {
  -            log.error( "error = cnfe " + cnfe.getMessage() );
  -        }
  -        // end try{
           catch ( Exception e )
           {
  -            log.logEx( e );
  +            log.error( e );
           }
  -        // end try{
   
           if ( item == null )
           {
  -            log.logIt( "item is null in LateralCacheServlet" );
  +            log.debug( "item is null in LateralCacheServlet" );
           }
           else
           {
               String hashtableName = item.getCacheName();
               Serializable key = item.getKey();
               Serializable val = item.getVal();
  -            if ( debug )
  -            {
  -                log.logIt( "item read in = " + item );
  -                log.logIt( "item.getKey = " + item.getKey() );
  -            }
  +
  +            log.debug( "item read in = " + item );
  +            log.debug( "item.getKey = " + item.getKey() );
   
               Cache cache = ( Cache ) cacheMgr.getCache( hashtableName );
               try
  @@ -136,7 +111,9 @@
                   cache.add( item );
               }
               catch ( Exception e )
  -            {}
  +            {
  +                // Ignored -- log it?
  +            }
           }
   
           try
  @@ -148,64 +125,43 @@
               ObjectOutputStream oos =
                   new ObjectOutputStream( response.getOutputStream() );
   
  -            if ( debug )
  -            {
  -                log.logIt( "Opened output stream.\n" );
  -            }
  +            log.debug( "Opened output stream.\n" );
   
               String result = "Completed transfer";
   
               // ECHO THE OBJECT TO THE RESPONSE
               oos.writeObject( result );
  -            if ( debug )
  -            {
  -                log.logIt( "Wrote object to output stream.\n" );
  -            }
  +            
  +            log.debug( "Wrote object to output stream" );
  +            
               oos.flush();
  -            if ( debug )
  -            {
  -                log.logIt( "Flushed output stream.\n" );
  -            }
  +            
  +            log.debug( "Flushed output stream.\n" );
  +            
               oos.close();
  -            if ( debug )
  -            {
  -                log.logIt( "Closed output stream.\n" );
  -            }
  +
  +            log.debug( "Closed output stream.\n" );
           }
  -        //CATCH EXCEPTIONS
           catch ( Exception e )
           {
               log.error( e );
           }
  -        // end try{
  -
  -        log.flush();
  -
       }
  -    //end service()
   
  -    /////////////////////////////////////////////////////////////////////////
       /**
  -     *  Description of the Method
  +     * 
        */
       public void destroy()
       {
           cacheMgr.release();
       }
   
  -
  -    //////////////////////////////////////////////////////////
  -    //Get Servlet information
       /**
  -     *  Gets the servletInfo attribute of the LateralCacheServletReciever object
  -     *
  -     *@return    The servletInfo value
  +     * Get servlet information
        */
       public String getServletInfo()
       {
           return "LateralCacheServlet v1";
       }
  -
   }
  -//end servlet
   
  
  
  
  1.8       +21 -53    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/tcp/LateralCacheTCPListener.java
  
  Index: LateralCacheTCPListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/tcp/LateralCacheTCPListener.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- LateralCacheTCPListener.java	18 Jan 2002 22:08:26 -0000	1.7
  +++ LateralCacheTCPListener.java	15 Feb 2002 04:33:37 -0000	1.8
  @@ -73,8 +73,8 @@
   import org.apache.stratum.jcs.engine.control.CacheManagerFactory;
   import org.apache.stratum.jcs.engine.control.CompositeCacheManager;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /////////////////////////////////////
   
  @@ -86,25 +86,12 @@
    *
    *@author     <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
    *@created    January 15, 2002
  - *@version    $Id: LateralCacheTCPListener.java,v 1.7 2002/01/18 22:08:26 asmuts Exp $
  + *@version    $Id: LateralCacheTCPListener.java,v 1.8 2002/02/15 04:33:37 jtaylor Exp $
    */
   public class LateralCacheTCPListener implements ILateralCacheTCPListener, Serializable
   {
  -
  -    /**
  -     *  Description of the Field
  -     */
  -    protected final static boolean debug = false;//true;
  -
  -    /**
  -     *  Description of the Field
  -     */
  -    protected final static boolean debugcmd = false;//true;
  -
  -    /**
  -     *  Description of the Field
  -     */
  -    protected static transient Logger log;
  +    private static final Log log = 
  +        LogSource.getInstance( LateralCacheTCPListener.class );
   
       /**
        *  Description of the Field
  @@ -131,7 +118,6 @@
       protected LateralCacheTCPListener( ILateralCacheAttributes ilca )
       {
           this.ilca = ilca;
  -        log = LoggerManager.getLogger( LateralCacheTCPListener.class );
       }
   
   
  @@ -172,9 +158,9 @@
           throws IOException
       {
           LateralCacheInfo.listenerId = id;
  -        if ( debugcmd )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "set listenerId = " + id );
  +            log.debug( "set listenerId = " + id );
           }
       }
   
  @@ -193,9 +179,9 @@
           //getCacheManager();
   
           //p( "get listenerId" );
  -        if ( debugcmd )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "get listenerId = " + LateralCacheInfo.listenerId );
  +            log.debug( "get listenerId = " + LateralCacheInfo.listenerId );
           }
           return LateralCacheInfo.listenerId;
       }
  @@ -221,9 +207,9 @@
                       ins = new LateralCacheTCPListener( ilca );
                       ins.init();
                   }
  -                if ( debug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "created new listener " + ilca.getTcpListenerPort() );
  +                    log.debug( "created new listener " + ilca.getTcpListenerPort() );
                   }
                   instances.put( String.valueOf( ilca.getTcpListenerPort() ), ins );
               }
  @@ -241,9 +227,9 @@
       public void handlePut( ICacheElement cb )
           throws IOException
       {
  -        if ( debugcmd )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "PUTTING ELEMENT FROM LATERAL" );
  +            log.debug( "PUTTING ELEMENT FROM LATERAL" );
           }
           getCacheManager();
           ICompositeCache cache = ( ICompositeCache ) cacheMgr.getCache( cb.getCacheName() );
  @@ -263,14 +249,10 @@
       public void handleRemove( String cacheName, Serializable key )
           throws IOException
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "handleRemove> cacheName=" + cacheName + ", key=" + key );
           }
  -        if ( debugcmd )
  -        {
  -            p( "handleRemove> cacheName=" + cacheName + ", key=" + key );
  -        }
   
           getCacheManager();
           // interface limitation here
  @@ -290,7 +272,7 @@
       public void handleRemoveAll( String cacheName )
           throws IOException
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "handleRemoveAll> cacheName=" + cacheName );
           }
  @@ -311,7 +293,7 @@
       public Serializable handleGet( String cacheName, Serializable key )
           throws IOException
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "handleGet> cacheName=" + cacheName + ", key = " + key );
           }
  @@ -331,7 +313,7 @@
       public void handleDispose( String cacheName )
           throws IOException
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "handleDispose> cacheName=" + cacheName );
           }
  @@ -350,31 +332,17 @@
           if ( cacheMgr == null )
           {
               cacheMgr = ( ICompositeCacheManager ) CacheManagerFactory.getInstance();
  -            if ( debugcmd )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "cacheMgr = " + cacheMgr );
  +                log.debug( "cacheMgr = " + cacheMgr );
               }
           }
           else
           {
  -            if ( debugcmd )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "already got cacheMgr = " + cacheMgr );
  +                log.debug( "already got cacheMgr = " + cacheMgr );
               }
           }
       }
  -
  -
  -    //////////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    public static void p( String s )
  -    {
  -        System.out.println( "LateralCacheTCPListener: " + s );
  -    }
  -
   }
  -// end class
  
  
  
  1.6       +17 -11    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/tcp/LateralGroupCacheTCPListener.java
  
  Index: LateralGroupCacheTCPListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/tcp/LateralGroupCacheTCPListener.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LateralGroupCacheTCPListener.java	18 Jan 2002 22:08:26 -0000	1.5
  +++ LateralGroupCacheTCPListener.java	15 Feb 2002 04:33:37 -0000	1.6
  @@ -63,15 +63,21 @@
   import org.apache.stratum.jcs.engine.group.GroupCacheManager;
   import org.apache.stratum.jcs.engine.group.GroupCacheManagerFactory;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
  +
   /**
    *@author     <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
    *@created    January 15, 2002
  - *@version    $Id: LateralGroupCacheTCPListener.java,v 1.5 2002/01/18 22:08:26 asmuts Exp $
  + *@version    $Id: LateralGroupCacheTCPListener.java,v 1.6 2002/02/15 04:33:37 jtaylor Exp $
    */
  -
  -public class LateralGroupCacheTCPListener extends LateralCacheTCPListener implements ILateralCacheTCPListener
  +public class LateralGroupCacheTCPListener 
  +    extends LateralCacheTCPListener 
  +    implements ILateralCacheTCPListener
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( LateralGroupCacheTCPListener.class );
  +    
       ///////////////////////////////////////////
       /**
        *  Constructor for the LateralGroupCacheTCPListener object
  @@ -81,7 +87,7 @@
       protected LateralGroupCacheTCPListener( ILateralCacheAttributes ilca )
       {
           super( ilca );
  -        p( "creating LateralGroupCacheTCPListener" );
  +        log.debug( "creating LateralGroupCacheTCPListener" );
       }
   
   
  @@ -105,9 +111,9 @@
                       ins = new LateralGroupCacheTCPListener( ilca );
                       ins.init();
                   }
  -                if ( debug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "created new listener " + ilca.getTcpListenerPort() );
  +                    log.debug( "created new listener " + ilca.getTcpListenerPort() );
                   }
                   instances.put( String.valueOf( ilca.getTcpListenerPort() ), ins );
               }
  @@ -130,16 +136,16 @@
               if ( cacheMgr == null )
               {
                   cacheMgr = ( ICompositeCacheManager ) GroupCacheManagerFactory.getInstance();
  -                if ( debugcmd )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( " groupcache cacheMgr = " + cacheMgr );
  +                    log.debug( " groupcache cacheMgr = " + cacheMgr );
                   }
               }
               else
               {
  -                if ( debugcmd )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "already got groupcache cacheMgr = " + cacheMgr );
  +                    log.debug( "already got groupcache cacheMgr = " + cacheMgr );
                   }
               }
           }
  
  
  
  1.7       +15 -30    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/tcp/LateralTCPReceiver.java
  
  Index: LateralTCPReceiver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/tcp/LateralTCPReceiver.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LateralTCPReceiver.java	18 Jan 2002 22:08:26 -0000	1.6
  +++ LateralTCPReceiver.java	15 Feb 2002 04:33:37 -0000	1.7
  @@ -60,8 +60,8 @@
   import org.apache.stratum.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
   import org.apache.stratum.jcs.auxiliary.lateral.socket.tcp.behavior.ILateralCacheTCPListener;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   ///////////////////////////////////////////////////////
   /**
  @@ -69,16 +69,15 @@
    *
    *@author     <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
    *@created    January 15, 2002
  - *@version    $Id: LateralTCPReceiver.java,v 1.6 2002/01/18 22:08:26 asmuts Exp $
  + *@version    $Id: LateralTCPReceiver.java,v 1.7 2002/02/15 04:33:37 jtaylor Exp $
    */
   public class LateralTCPReceiver implements Runnable
   {
  -
  -    private final static boolean debug = false;
  -    // true;
  -
  +    private static final Log log = 
  +        LogSource.getInstance( LateralTCPReceiver.class );
  +        
       private int port;
  -    private final static Logger log = LoggerManager.getLogger( "lateral_lateralcachemanager" );
  +
       private ILateralCacheTCPListener ilcl;
   
       /**
  @@ -95,25 +94,25 @@
       {
           try
           {
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "Listening on port " + port );
  +                log.debug( "Listening on port " + port );
               }
               log.info( "Listening on port " + port );
               ServerSocket serverSocket = new ServerSocket( port );
               serverSocket.setSoTimeout( this.sTimeOut );
               while ( true )
               {
  -                if ( debug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "Waiting for clients to connect " );
  +                    log.debug( "Waiting for clients to connect " );
                   }
                   log.info( "Waiting for clients to client " );
                   Socket socket = serverSocket.accept();
                   InetAddress inetAddress = socket.getInetAddress();
  -                if ( debug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "Connected to client at " + inetAddress );
  +                    log.debug( "Connected to client at " + inetAddress );
                   }
                   log.info( "Connected to client at " + inetAddress );
                   log.info( "Starting new socket node." );
  @@ -138,23 +137,9 @@
       {
           this.port = lca.getTcpListenerPort();
           this.ilcl = ilcl;
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "ilcl = " + ilcl );
  +            log.debug( "ilcl = " + ilcl );
           }
       }
  -
  -
  -    ///////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p( String s )
  -    {
  -        System.out.println( "LateralTCPReceiver: " + s );
  -    }
  -
   }
  -// end class
  
  
  
  1.7       +30 -66    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/tcp/LateralTCPReceiverConnection.java
  
  Index: LateralTCPReceiverConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/tcp/LateralTCPReceiverConnection.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LateralTCPReceiverConnection.java	18 Jan 2002 22:08:26 -0000	1.6
  +++ LateralTCPReceiverConnection.java	15 Feb 2002 04:33:37 -0000	1.7
  @@ -65,46 +65,32 @@
   
   import org.apache.stratum.jcs.auxiliary.lateral.socket.tcp.behavior.ILateralCacheTCPListener;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
  -/////////////////////////////////////////////////////
   /**
  - *  Separate thread run when a command comes into the LateralTCPReceiver.
  + * Separate thread run when a command comes into the LateralTCPReceiver.
    *
  - *@author     <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
  - *@created    January 15, 2002
  - *@version    $Id: LateralTCPReceiverConnection.java,v 1.6 2002/01/18 22:08:26 asmuts Exp $
  + * @author <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
  + * @version $Id: LateralTCPReceiverConnection.java,v 1.7 2002/02/15 04:33:37 jtaylor Exp $
    */
   public class LateralTCPReceiverConnection implements Runnable
   {
  -
  -    /**
  -     *  Development debugging.
  -     */
  -    protected final static boolean debug = false;
  -    /**
  -     *  Print every 100 puts.
  -     */
  -    protected final static boolean debugput = true;
  -
  +    private static final Log log = 
  +        LogSource.getInstance( LateralTCPReceiverConnection.class );
  +    
       private Socket socket;
       private ObjectInputStream ois;
   
       private ILateralCacheTCPListener ilcl;
  -    private final static Logger log = LoggerManager.getLogger( "lateral_lateralcachemanager" );
   
       private int puts = 0;
   
  -
  -    //////////////////////////////////////////////////////////////////
       /**
  -     *  Constructor for the LateralTCPReceiverConnection object
  -     *
  -     *@param  socket  Description of the Parameter
  -     *@param  ilcl    Description of the Parameter
  +     * Constructor for the LateralTCPReceiverConnection object
        */
  -    public LateralTCPReceiverConnection( Socket socket, ILateralCacheTCPListener ilcl )
  +    public LateralTCPReceiverConnection( Socket socket, 
  +                                         ILateralCacheTCPListener ilcl )
       {
           this.ilcl = ilcl;
           this.socket = socket;
  @@ -115,7 +101,7 @@
           }
           catch ( Exception e )
           {
  -            log.error( e, "Could not open ObjectInputStream to " + socket );
  +            log.error( "Could not open ObjectInputStream to " + socket, e );
           }
       }
   
  @@ -126,7 +112,6 @@
        */
       public void run()
       {
  -
           Object obj;
   
           try
  @@ -137,35 +122,31 @@
                   LateralElementDescriptor led = ( LateralElementDescriptor ) obj;
                   if ( led == null )
                   {
  -                    p( "led is null" );
  +                    log.debug( "LateralElementDescriptor is null" );
                       continue;
                   }
                   if ( led.requesterId == LateralCacheInfo.listenerId )
                   {
  -                    if ( debug )
  -                    {
  -                        p( "from self" );
  -                    }
  +                    log.debug( "from self" );
                   }
                   else
                   {
  -                    log.debug( "receiving led from another" );
  -                    if ( debug )
  +                    if ( log.isDebugEnabled() )
                       {
  -                        p( "from another" );
  -                        p( "led = " + led );
  -                        p( "led.command = " + led.command );
  -                        p( "led.ce = " + led.ce );
  -                        p( "ilcl = " + ilcl );
  +                        log.debug( "receiving LateralElementDescriptor from another, led = "
  +                            + ", led = " + led
  +                            + ", led.command = " + led.command
  +                            + ", led.ce = " + led.ce
  +                            + ", ilcl = " + ilcl );
                       }
                       if ( led.command == led.UPDATE )
                       {
                           puts++;
  -                        if ( debugput )
  +                        if ( log.isDebugEnabled() )
                           {
                               if ( puts % 100 == 0 )
                               {
  -                                p( "puts = " + puts );
  +                                log.debug( "puts = " + puts );
                               }
                           }
                           ilcl.handlePut( led.ce );
  @@ -194,7 +175,7 @@
           }
           catch ( Exception e )
           {
  -            log.error( e, "Unexpected exception. Closing conneciton." );
  +            log.error( "Unexpected exception. Closing conneciton", e );
           }
   
           try
  @@ -203,30 +184,26 @@
           }
           catch ( Exception e )
           {
  -            log.error( e, "Could not close connection." );
  +            log.error( "Could not close connection", e );
           }
       }
   
   
       /**
  -     *  Send back the object if found.
  -     *
  -     *@param  cacheName      Description of the Parameter
  -     *@param  key            Description of the Parameter
  -     *@return                The andRespond value
  -     *@exception  Exception  Description of the Exception
  +     * Send back the object if found.
        */
       private Serializable getAndRespond( String cacheName, Serializable key )
           throws Exception
       {
           Serializable obj = ilcl.handleGet( cacheName, key );
   
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "obj = " + obj );
  +            log.debug( "obj = " + obj );
           }
   
           ObjectOutputStream oos = new ObjectOutputStream( socket.getOutputStream() );
  +        
           if ( oos != null )
           {
               try
  @@ -237,23 +214,10 @@
               catch ( IOException e )
               {
                   oos = null;
  -                log.error( "Detected problem with connection: " + e );
  +                log.error( "Detected problem with connection", e );
                   throw e;
               }
           }
           return obj;
       }
  -
  -    ///////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p( String s )
  -    {
  -        System.out.println( "LateralTCPReceiver: " + s );
  -    }
  -
  -}
  -// end class
  +}
  \ No newline at end of file
  
  
  
  1.7       +13 -35    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java
  
  Index: LateralTCPSender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LateralTCPSender.java	18 Jan 2002 22:08:26 -0000	1.6
  +++ LateralTCPSender.java	15 Feb 2002 04:33:37 -0000	1.7
  @@ -24,8 +24,8 @@
   
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  This class is based on the log4j SocketAppender class. I'm using a differnet
  @@ -33,14 +33,12 @@
    *
    *@author     <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
    *@created    January 15, 2002
  - *@version    $Id: LateralTCPSender.java,v 1.6 2002/01/18 22:08:26 asmuts Exp $
  + *@version    $Id: LateralTCPSender.java,v 1.7 2002/02/15 04:33:37 jtaylor Exp $
    */
   public class LateralTCPSender
   {
  -
  -    private final static boolean debug = false;
  -
  -    private static Logger log = LoggerManager.getLogger( LateralTCPSender.class );
  +    private static final Log log = 
  +        LogSource.getInstance( LateralTCPSender.class );
   
       private ILateralCacheAttributes ilca;
   
  @@ -80,7 +78,7 @@
           String p1 = lca.getTcpServer();
           String h2 = p1.substring( 0, p1.indexOf( ":" ) );
           int po = Integer.parseInt( p1.substring( p1.indexOf( ":" ) + 1 ) );
  -        p( "h2 = " + h2 );
  +        log.debug( "h2 = " + h2 );
           init( h2, po );
           this.ilca = lca;
       }
  @@ -150,7 +148,7 @@
           }
           catch ( Exception e )
           {
  -            log.error( e, "Could not find address of [" + host + "]." );
  +            log.error( "Could not find address of [" + host + "]", e );
               return null;
           }
       }
  @@ -166,11 +164,7 @@
       public void send( LateralElementDescriptor led )
           throws IOException
       {
  -
  -        if ( debug )
  -        {
  -            p( "sending led" );
  -        }
  +        log.debug( "sending LateralElementDescriptor" );
   
           if ( led == null )
           {
  @@ -222,12 +216,9 @@
       public Serializable sendAndReceive( LateralElementDescriptor led )
           throws IOException
       {
  -
           ICacheElement ice = null;
  -        if ( debug )
  -        {
  -            p( "sendAndReceive led" );
  -        }
  +        
  +        log.debug( "sendAndReceive led" );
   
           if ( led == null )
           {
  @@ -261,7 +252,7 @@
                   }
                   catch ( IOException ioe )
                   {
  -                    log.error( ioe, "Could not open ObjectInputStream to " + socket );
  +                    log.error( "Could not open ObjectInputStream to " + socket, ioe );
                   }
                   catch ( Exception e )
                   {
  @@ -287,19 +278,6 @@
           return ice;
       }// end sendAndReceive
   
  -
  -    ///////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p( String s )
  -    {
  -        System.out.println( "LateralTCPSender: " + s );
  -    }
  -
  -
       // Service Methods //
       ////////////////////////////////////////////////////
       /**
  @@ -436,7 +414,7 @@
   
               while ( notDone )
               {
  -                p( "enter mesage:" );
  +                System.out.println( "enter mesage:" );
                   message = br.readLine();
                   CacheElement ce = new CacheElement( "test", "test", message );
                   LateralElementDescriptor led = new LateralElementDescriptor( ce );
  @@ -445,7 +423,7 @@
           }
           catch ( Exception e )
           {
  -            p( e.toString() );
  +            System.out.println( e.toString() );
           }
       }
   
  
  
  
  1.6       +49 -143   jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/tcp/LateralTCPService.java
  
  Index: LateralTCPService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/tcp/LateralTCPService.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LateralTCPService.java	18 Jan 2002 22:08:26 -0000	1.5
  +++ LateralTCPService.java	15 Feb 2002 04:33:37 -0000	1.6
  @@ -74,32 +74,27 @@
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   import org.apache.stratum.jcs.engine.behavior.ICacheListener;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  A lateral cache service implementation.
    *
    *@author     <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
    *@created    January 15, 2002
  - *@version    $Id: LateralTCPService.java,v 1.5 2002/01/18 22:08:26 asmuts Exp $
  + *@version    $Id: LateralTCPService.java,v 1.6 2002/02/15 04:33:37 jtaylor Exp $
    */
  -public class LateralTCPService implements ILateralCacheService, ILateralCacheObserver
  +public class LateralTCPService 
  +    implements ILateralCacheService, ILateralCacheObserver
   {
  -
  -    private static boolean debug = false;//true;
  -
  -    private static Logger log = LoggerManager.getLogger( LateralTCPSender.class );
  +    private static final Log log = 
  +        LogSource.getInstance( LateralTCPService.class );
  +    
       private ILateralCacheAttributes ilca;
       private LateralTCPSender sender;
   
  -
  -    /////////////////////////////////////////////////////////////////
       /**
  -     *  Constructor for the LateralTCPService object
  -     *
  -     *@param  lca              Description of the Parameter
  -     *@exception  IOException  Description of the Exception
  +     * Constructor for the LateralTCPService object
        */
       public LateralTCPService( ILateralCacheAttributes lca )
           throws IOException
  @@ -107,44 +102,24 @@
           this.ilca = lca;
           try
           {
  -            if ( debug )
  -            {
  -                p( "creating sender" );
  -            }
  +            log.debug( "creating sender" );
  +            
               sender = new LateralTCPSender( lca );
  -            if ( debug )
  -            {
  -                p( "create sendered" );
  -            }
  +
  +            log.debug( "created sender" );
           }
           catch ( IOException e )
           {
  -            log.error( e );
  -            p( "Could not create sender" );
  +            log.error( "Could not create sender", e );
  +
               throw e;
           }
       }
  -
  -
  -    ///////////////////////////////////////////////
  +    
  +    // -------------------------------------------------------- Service Methods
  +    
       /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p( String s )
  -    {
  -        System.out.println( "LateralTCPService: " + s );
  -    }
  -
  -
  -    // Service Methods //
  -    ////////////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  item             Description of the Parameter
  -     *@exception  IOException  Description of the Exception
  +     * 
        */
       public void update( ICacheElement item )
           throws IOException
  @@ -152,13 +127,8 @@
           update( item, LateralCacheInfo.listenerId );
       }
   
  -
       /**
  -     *  Description of the Method
        *
  -     *@param  item             Description of the Parameter
  -     *@param  requesterId      Description of the Parameter
  -     *@exception  IOException  Description of the Exception
        */
       public void update( ICacheElement item, byte requesterId )
           throws IOException
  @@ -169,14 +139,8 @@
           sender.send( led );
       }
   
  -
  -    ////////////////////////////////////////////////////////////
       /**
  -     *  Description of the Method
  -     *
  -     *@param  cacheName        Description of the Parameter
  -     *@param  key              Description of the Parameter
  -     *@exception  IOException  Description of the Exception
  +     * 
        */
       public void remove( String cacheName, Serializable key )
           throws IOException
  @@ -184,14 +148,8 @@
           remove( cacheName, key, LateralCacheInfo.listenerId );
       }
   
  -
       /**
  -     *  Description of the Method
        *
  -     *@param  cacheName        Description of the Parameter
  -     *@param  key              Description of the Parameter
  -     *@param  requesterId      Description of the Parameter
  -     *@exception  IOException  Description of the Exception
        */
       public void remove( String cacheName, Serializable key, byte requesterId )
           throws IOException
  @@ -203,12 +161,8 @@
           sender.send( led );
       }
   
  -
  -    /////////////////////////////////////////////////////
       /**
  -     *  Description of the Method
  -     *
  -     *@exception  IOException  Description of the Exception
  +     * 
        */
       public void release()
           throws IOException
  @@ -216,12 +170,8 @@
           // nothing needs to be done
       }
   
  -
       /**
  -     *  Will close the connection.
  -     *
  -     *@param  cache            Description of the Parameter
  -     *@exception  IOException  Description of the Exception
  +     * Will close the connection.
        */
       public void dispose( String cache )
           throws IOException
  @@ -229,14 +179,8 @@
           sender.dispose( cache );
       }
   
  -
  -    ///////////////////////////////////////////////////////////////
       /**
  -     *  Description of the Method
  -     *
  -     *@param  key              Description of the Parameter
  -     *@return                  Description of the Return Value
  -     *@exception  IOException  Description of the Exception
  +     * 
        */
       public Serializable get( String key )
           throws IOException
  @@ -247,15 +191,8 @@
           // nothing needs to be done
       }
   
  -    ///////////////////////////////////////////////////////////////
  -
       /**
  -     *  Description of the Method
        *
  -     *@param  cacheName        Description of the Parameter
  -     *@param  key              Description of the Parameter
  -     *@return                  Description of the Return Value
  -     *@exception  IOException  Description of the Exception
        */
       public Serializable get( String cacheName, Serializable key )
           throws IOException
  @@ -264,22 +201,13 @@
           return get( cacheName, key, true );
           // nothing needs to be done
       }
  -
  -    ///////////////////////////////////////////////////////////////
  -
  +    
       /**
  -     *  An expiremental get implementation. By default it should be off.
  -     *
  -     *@param  container        Description of the Parameter
  -     *@param  cacheName        Description of the Parameter
  -     *@param  key              Description of the Parameter
  -     *@return                  Description of the Return Value
  -     *@exception  IOException  Description of the Exception
  +     * An expiremental get implementation. By default it should be off.
        */
       public Serializable get( String cacheName, Serializable key, boolean container )
           throws IOException
       {
  -
           //p( "get(cacheName,key,container)" );
           CacheElement ce = new CacheElement( cacheName, key, null );
           LateralElementDescriptor led = new LateralElementDescriptor( ce );
  @@ -290,13 +218,8 @@
           // nothing needs to be done
       }
   
  -
  -    /////////////////////////////////////////////////////////////
       /**
  -     *  Description of the Method
        *
  -     *@param  cacheName        Description of the Parameter
  -     *@exception  IOException  Description of the Exception
        */
       public void removeAll( String cacheName )
           throws IOException
  @@ -304,13 +227,8 @@
           removeAll( cacheName, LateralCacheInfo.listenerId );
       }
   
  -
       /**
  -     *  Description of the Method
        *
  -     *@param  cacheName        Description of the Parameter
  -     *@param  requesterId      Description of the Parameter
  -     *@exception  IOException  Description of the Exception
        */
       public void removeAll( String cacheName, byte requesterId )
           throws IOException
  @@ -322,28 +240,26 @@
           sender.send( led );
       }
   
  -
  -    ////////////////////////////////////////////////
       /**
  -     *  Description of the Method
        *
  -     *@param  args  Description of the Parameter
        */
       public static void main( String args[] )
       {
           try
           {
  -            LateralTCPSender sender = new LateralTCPSender( new LateralCacheAttributes() );
  +            LateralTCPSender sender = 
  +                new LateralTCPSender( new LateralCacheAttributes() );
   
               // process user input till done
               boolean notDone = true;
               String message = null;
               // wait to dispose
  -            BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) );
  +            BufferedReader br = 
  +                new BufferedReader( new InputStreamReader( System.in ) );
   
               while ( notDone )
               {
  -                p( "enter mesage:" );
  +                System.out.println( "enter mesage:" );
                   message = br.readLine();
                   CacheElement ce = new CacheElement( "test", "test", message );
                   LateralElementDescriptor led = new LateralElementDescriptor( ce );
  @@ -352,60 +268,50 @@
           }
           catch ( Exception e )
           {
  -            p( e.toString() );
  +            System.out.println( e.toString() );
           }
       }
   
  -
       // ILateralCacheObserver methods, do nothing here since
       // the connection is not registered, the udp service is
       // is not registered.
  +    
       /**
  -     *  Adds a feature to the CacheListener attribute of the LateralTCPService
  -     *  object
        *
  -     *@param  cacheName        The feature to be added to the CacheListener
  -     *      attribute
  -     *@param  obj              The feature to be added to the CacheListener
  -     *      attribute
  -     *@exception  IOException  Description of the Exception
        */
       public void addCacheListener( String cacheName, ICacheListener obj )
  -        throws IOException { }
  -
  +        throws IOException
  +    { 
  +        // Empty
  +    }
   
       /**
  -     *  Adds a feature to the CacheListener attribute of the LateralTCPService
  -     *  object
        *
  -     *@param  obj              The feature to be added to the CacheListener
  -     *      attribute
  -     *@exception  IOException  Description of the Exception
        */
       public void addCacheListener( ICacheListener obj )
  -        throws IOException { }
  +        throws IOException
  +    { 
  +        // Empty
  +    }
   
   
       /**
  -     *  Description of the Method
        *
  -     *@param  cacheName        Description of the Parameter
  -     *@param  obj              Description of the Parameter
  -     *@exception  IOException  Description of the Exception
        */
       public void removeCacheListener( String cacheName, ICacheListener obj )
  -        throws IOException { }
  -
  +        throws IOException
  +    { 
  +        // Empty
  +    }
   
       /**
  -     *  Description of the Method
  -     *
  -     *@param  obj              Description of the Parameter
  -     *@exception  IOException  Description of the Exception
  +     * 
        */
       public void removeCacheListener( ICacheListener obj )
  -        throws IOException { }
  +        throws IOException 
  +    { 
  +        // Empty
  +    }
   
   }
  -// end class
   
  
  
  
  1.4       +23 -52    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/udp/LateralCacheUDPListener.java
  
  Index: LateralCacheUDPListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/udp/LateralCacheUDPListener.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LateralCacheUDPListener.java	15 Jan 2002 21:33:32 -0000	1.3
  +++ LateralCacheUDPListener.java	15 Feb 2002 04:33:37 -0000	1.4
  @@ -19,8 +19,8 @@
   import org.apache.stratum.jcs.engine.control.CacheManagerFactory;
   import org.apache.stratum.jcs.engine.control.CompositeCacheManager;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /////////////////////////////////////
   
  @@ -35,25 +35,14 @@
    */
   public class LateralCacheUDPListener implements ILateralCacheListener, Serializable
   {
  -
  -    /**
  -     *  Description of the Field
  -     */
  -    protected final static boolean debug = false;
  -    //true;
  -    /**
  -     *  Description of the Field
  -     */
  -    protected final static boolean debugcmd = false;
  -    //true;
  -    /**
  -     *  Description of the Field
  -     */
  -    protected static transient Logger log;
  +    private static final Log log = 
  +        LogSource.getInstance( LateralCacheUDPListener.class );
  +    
       /**
        *  Description of the Field
        */
       protected static transient ICompositeCacheManager cacheMgr;
  +    
       /**
        *  Description of the Field
        */
  @@ -74,7 +63,7 @@
        */
       protected LateralCacheUDPListener( ILateralCacheAttributes ilca )
       {
  -        log = LoggerManager.getLogger( "lateral_lateralcachemanager" );
  +        // Empty
       }
   
   
  @@ -114,9 +103,9 @@
           throws IOException
       {
           LateralCacheInfo.listenerId = id;
  -        if ( debugcmd )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "set listenerId = " + id );
  +            log.debug( "set listenerId = " + id );
           }
       }
   
  @@ -135,9 +124,9 @@
           //getCacheManager();
   
           //p( "get listenerId" );
  -        if ( debugcmd )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "get listenerId = " + LateralCacheInfo.listenerId );
  +            log.debug( "get listenerId = " + LateralCacheInfo.listenerId );
           }
           return LateralCacheInfo.listenerId;
       }
  @@ -163,9 +152,9 @@
                       ins = new LateralCacheUDPListener( ilca );
                       ins.init();
                   }
  -                if ( debug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "created new listener " + ilca.getUdpMulticastAddr() + ":" + ilca.getUdpMulticastPort() );
  +                    log.debug( "created new listener " + ilca.getUdpMulticastAddr() + ":" + ilca.getUdpMulticastPort() );
                   }
                   instances.put( ilca.getUdpMulticastAddr() + ":" + ilca.getUdpMulticastPort(), ins );
               }
  @@ -183,9 +172,9 @@
       public void handlePut( ICacheElement cb )
           throws IOException
       {
  -        if ( debugcmd )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "PUTTING ELEMENT FROM LATERAL" );
  +            log.debug( "PUTTING ELEMENT FROM LATERAL" );
           }
           getCacheManager();
           ICompositeCache cache = ( ICompositeCache ) cacheMgr.getCache( cb.getCacheName() );
  @@ -205,14 +194,10 @@
       public void handleRemove( String cacheName, Serializable key )
           throws IOException
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "handleRemove> cacheName=" + cacheName + ", key=" + key );
           }
  -        if ( debugcmd )
  -        {
  -            p( "handleRemove> cacheName=" + cacheName + ", key=" + key );
  -        }
   
           getCacheManager();
           // interface limitation here
  @@ -232,7 +217,7 @@
       public void handleRemoveAll( String cacheName )
           throws IOException
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "handleRemoveAll> cacheName=" + cacheName );
           }
  @@ -252,7 +237,7 @@
       public void handleDispose( String cacheName )
           throws IOException
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "handleDispose> cacheName=" + cacheName );
           }
  @@ -271,32 +256,18 @@
           if ( cacheMgr == null )
           {
               cacheMgr = ( ICompositeCacheManager ) CacheManagerFactory.getInstance();
  -            p( "had to get cacheMgr" );
  -            if ( debugcmd )
  +
  +            if ( log.isDebugEnabled() )
               {
  -                p( "cacheMgr = " + cacheMgr );
  +                log.debug( "had to get cacheMgr: " + cacheMgr );
               }
           }
           else
           {
  -            if ( debugcmd )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "already got cacheMgr = " + cacheMgr );
  +                log.debug( "already got cacheMgr: " + cacheMgr );
               }
           }
       }
  -
  -
  -    //////////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    public static void p( String s )
  -    {
  -        System.out.println( "LateralCacheListener: " + s );
  -    }
  -
   }
  -// end class
  
  
  
  1.4       +19 -18    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/udp/LateralGroupCacheUDPListener.java
  
  Index: LateralGroupCacheUDPListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/udp/LateralGroupCacheUDPListener.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LateralGroupCacheUDPListener.java	15 Jan 2002 21:33:32 -0000	1.3
  +++ LateralGroupCacheUDPListener.java	15 Feb 2002 04:33:37 -0000	1.4
  @@ -16,7 +16,8 @@
   import org.apache.stratum.jcs.engine.group.GroupCacheManager;
   import org.apache.stratum.jcs.engine.group.GroupCacheManagerFactory;
   
  -/////////////////////////////////////
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   ///////////////////////////////////////////////////////////////////////
   /**
  @@ -25,9 +26,13 @@
    *@author     asmuts
    *@created    January 15, 2002
    */
  -public class LateralGroupCacheUDPListener extends LateralCacheUDPListener implements ILateralCacheListener, Serializable
  +public class LateralGroupCacheUDPListener 
  +    extends LateralCacheUDPListener 
  +    implements ILateralCacheListener, Serializable
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( LateralGroupCacheUDPListener.class );
  +    
       ///////////////////////////////////////////
       /**
        *  Constructor for the LateralGroupCacheUDPListener object
  @@ -37,7 +42,7 @@
       protected LateralGroupCacheUDPListener( ILateralCacheAttributes ilca )
       {
           super( ilca );
  -        p( "creating LateralGroupCacheUDPListener" );
  +        log.debug( "creating LateralGroupCacheUDPListener" );
       }
   
   
  @@ -60,9 +65,9 @@
                   {
                       ins = new LateralGroupCacheUDPListener( ilca );
                   }
  -                if ( debug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "created new listener " + ilca.getUdpMulticastAddr() + ":" + ilca.getUdpMulticastPort() );
  +                    log.debug( "created new listener " + ilca.getUdpMulticastAddr() + ":" + ilca.getUdpMulticastPort() );
                   }
                   instances.put( ilca.getUdpMulticastAddr() + ":" + ilca.getUdpMulticastPort(), ins );
               }
  @@ -88,20 +93,15 @@
           throws IOException
       {
   
  -        if ( debugcmd )
  -        {
  -            p( "PUTTING ELEMENT FROM REMOTE" );
  -        }
  +
  +        log.debug( "PUTTING ELEMENT FROM REMOTE" );
   
           // could put this in the group cache.
           if ( cb.getKey() instanceof GroupAttrName )
           {
               try
               {
  -                if ( debug )
  -                {
  -                    p( "putting gi for ga method" );
  -                }
  +                log.debug( "putting gi for ga method" );
   
                   // need to lean up the group putting
                   /*
  @@ -136,16 +136,17 @@
               if ( cacheMgr == null )
               {
                   cacheMgr = ( ICompositeCacheManager ) GroupCacheManagerFactory.getInstance();
  -                if ( debugcmd )
  +                
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( " groupcache cacheMgr = " + cacheMgr );
  +                    log.debug( " groupcache cacheMgr = " + cacheMgr );
                   }
               }
               else
               {
  -                if ( debugcmd )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "already got groupcache cacheMgr = " + cacheMgr );
  +                    log.debug( "already got groupcache cacheMgr = " + cacheMgr );
                   }
               }
           }
  
  
  
  1.4       +11 -26    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/udp/LateralUDPReceiver.java
  
  Index: LateralUDPReceiver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/udp/LateralUDPReceiver.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LateralUDPReceiver.java	15 Jan 2002 21:33:32 -0000	1.3
  +++ LateralUDPReceiver.java	15 Feb 2002 04:33:37 -0000	1.4
  @@ -15,8 +15,8 @@
   import org.apache.stratum.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
   import org.apache.stratum.jcs.auxiliary.lateral.behavior.ILateralCacheListener;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  A highly unreliable UDP receiver. It is easy to outrun. Uncaught message
  @@ -27,14 +27,12 @@
    */
   public class LateralUDPReceiver implements Runnable
   {
  -
  -    private final static boolean debug = true;
  +    private static final Log log = 
  +        LogSource.getInstance( LateralUDPReceiver.class );
   
       private final byte[] m_buffer = new byte[65536];
       private MulticastSocket m_socket;
   
  -    private static Logger log = LoggerManager.getLogger( LateralUDPReceiver.class );
  -
       ILateralCacheListener ilcl;
   
   
  @@ -66,7 +64,7 @@
           throws IOException
       {
   
  -        p( "constructing listener, " + multicastAddressString + ":" + multicastPort );
  +        log.debug( "constructing listener, " + multicastAddressString + ":" + multicastPort );
   
           try
           {
  @@ -76,7 +74,7 @@
           catch ( IOException e )
           {
               log.error( e );
  -            p( "Could not bind to multicast address " + multicastAddressString + ":" + multicastPort );
  +            log.debug( "Could not bind to multicast address " + multicastAddressString + ":" + multicastPort );
               //throw e ;//new CacheException( "Could not bind to multicast address " + multicastAddressString + ":" + multicastPort, e);
           }
       }
  @@ -134,16 +132,16 @@
                   LateralElementDescriptor led = ( LateralElementDescriptor ) obj;
                   if ( led.requesterId == LateralCacheInfo.listenerId )
                   {
  -                    if ( debug )
  +                    if ( log.isDebugEnabled() )
                       {
  -                        p( "from self" );
  +                        log.debug( "from self" );
                       }
                   }
                   else
                   {
  -                    if ( debug )
  +                    if ( log.isDebugEnabled() )
                       {
  -                        p( "from another" );
  +                        log.debug( "from another" );
                       }
                       if ( led.command == led.UPDATE )
                       {
  @@ -161,19 +159,6 @@
           {
           }
       }
  -    // end run
  -
  -    ///////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p( String s )
  -    {
  -        System.out.println( "LateralUDPReceiver: " + s );
  -    }
  -
   
       ////////////////////////////////////////////////
       /**
  @@ -191,7 +176,7 @@
           }
           catch ( Exception e )
           {
  -            p( e.toString() );
  +            log.error( e.toString() );
           }
       }
   
  
  
  
  1.4       +13 -42    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/udp/LateralUDPSender.java
  
  Index: LateralUDPSender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/udp/LateralUDPSender.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LateralUDPSender.java	15 Jan 2002 21:33:32 -0000	1.3
  +++ LateralUDPSender.java	15 Feb 2002 04:33:37 -0000	1.4
  @@ -24,8 +24,8 @@
   
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *@author     asmuts
  @@ -33,15 +33,13 @@
    */
   public class LateralUDPSender
   {
  -
  -    private final static boolean debug = true;
  -
  +    private static final Log log = 
  +        LogSource.getInstance( LateralUDPSender.class );  
  +    
       private MulticastSocket m_localSocket;
       private InetAddress m_multicastAddress;
       private int m_multicastPort;
   
  -    private static Logger log = LoggerManager.getLogger( LateralUDPSender.class );
  -
       private ILateralCacheAttributes ilca;
   
   
  @@ -55,12 +53,6 @@
       public LateralUDPSender( ILateralCacheAttributes lca )
           throws IOException
       {
  -
  -        if ( debug )
  -        {
  -            p( "contructing lca" );
  -        }
  -
           this.ilca = lca;
   
           try
  @@ -74,10 +66,10 @@
           }
           catch ( IOException e )
           {
  -            log.error( e );
  -            p( "Could not bind to multicast address " + lca.getUdpMulticastAddr() );
  +            log.error( "Could not bind to multicast address " + 
  +                       lca.getUdpMulticastAddr(), e );
  +
               throw e;
  -            //new CacheException("Could not bind to multicast address " + multicastAddressString);
           }
   
           m_multicastPort = lca.getUdpMulticastPort();
  @@ -94,11 +86,7 @@
       public void send( LateralElementDescriptor led )
           throws IOException
       {
  -
  -        if ( debug )
  -        {
  -            p( "sending led" );
  -        }
  +        log.debug( "sending LateralElementDescriptor" );
   
           try
           {
  @@ -117,26 +105,12 @@
           }
           catch ( IOException e )
           {
  -            log.error( e );
  -            p( "Exception sending message" );
  +            log.error( "Error sending message", e );
  +
               throw e;
  -            //new CacheException(	"Exception sending led", e);
           }
       }
   
  -
  -    ///////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p( String s )
  -    {
  -        System.out.println( "LateralUDPSender: " + s );
  -    }
  -
  -
       // Service Methods //
       ////////////////////////////////////////////////////
       /**
  @@ -268,7 +242,7 @@
   
               while ( notDone )
               {
  -                p( "enter mesage:" );
  +                System.out.println( "enter mesage:" );
                   message = br.readLine();
                   CacheElement ce = new CacheElement( "test", "test", message );
                   LateralElementDescriptor led = new LateralElementDescriptor( ce );
  @@ -277,12 +251,11 @@
           }
           catch ( Exception e )
           {
  -            p( e.toString() );
  +            System.out.println( e.toString() );
           }
       }
   
   }
  -// end class
   
   ///////////////////////////////////////////////////////////
   /**
  @@ -293,8 +266,6 @@
    */
   class MyByteArrayOutputStream extends ByteArrayOutputStream
   {
  -
  -
       /**
        *  Gets the bytes attribute of the MyByteArrayOutputStream object
        *
  
  
  
  1.4       +8 -25     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/udp/LateralUDPService.java
  
  Index: LateralUDPService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/lateral/socket/udp/LateralUDPService.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LateralUDPService.java	15 Jan 2002 21:33:32 -0000	1.3
  +++ LateralUDPService.java	15 Feb 2002 04:33:37 -0000	1.4
  @@ -21,8 +21,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   import org.apache.stratum.jcs.engine.behavior.ICacheListener;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Description of the Class
  @@ -32,15 +32,13 @@
    */
   public class LateralUDPService implements ILateralCacheService, ILateralCacheObserver
   {
  -
  -    private static Logger log = LoggerManager.getLogger( LateralUDPSender.class );
  +    private static final Log log = 
  +        LogSource.getInstance( LateralUDPService.class );    
   
       private ILateralCacheAttributes ilca;
   
       private LateralUDPSender sender;
   
  -
  -    /////////////////////////////////////////////////////////////////
       /**
        *  Constructor for the LateralUDPService object
        *
  @@ -60,28 +58,13 @@
           }
           catch ( IOException e )
           {
  -            log.error( e );
  -            p( "Could not create sender" );
  +            log.error( "Could not create sender", e );
  +
               throw e;
           }
   
       }
   
  -
  -    ///////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p( String s )
  -    {
  -        System.out.println( "LateralUDPService: " + s );
  -    }
  -
  -
  -    // Service Methods //
  -    ////////////////////////////////////////////////////
       /**
        *  Description of the Method
        *
  @@ -276,7 +259,7 @@
   
               while ( notDone )
               {
  -                p( "enter mesage:" );
  +                System.out.println( "enter mesage:" );
                   message = br.readLine();
                   CacheElement ce = new CacheElement( "test", "test", message );
                   LateralElementDescriptor led = new LateralElementDescriptor( ce );
  @@ -285,7 +268,7 @@
           }
           catch ( Exception e )
           {
  -            p( e.toString() );
  +            System.out.println( e.toString() );
           }
       }
   
  
  
  
  1.7       +14 -31    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCache.java
  
  Index: RemoteCache.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCache.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RemoteCache.java	29 Jan 2002 06:12:57 -0000	1.6
  +++ RemoteCache.java	15 Feb 2002 04:33:37 -0000	1.7
  @@ -16,8 +16,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICache;
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   import org.apache.stratum.jcs.utils.reuse.IZombie;
   
  @@ -29,14 +29,10 @@
    */
   public class RemoteCache implements ICache
   {
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteCache.class );
   
  -    private static boolean dbug = false;
  -    //true;
  -    Logger log;
       private static int numCreated = 0;
  -    private static boolean debug = false;//true;
  -    private static boolean debugR = false;
  -    private static boolean debugPut = false;
   
       final String cacheName;
       private IRemoteCacheService remote;
  @@ -87,12 +83,11 @@
           this.irca = cattr;
           this.cacheName = cattr.getCacheName();
           this.remote = remote;
  -        log = LoggerManager.getLogger( this );
   
  -        if ( dbug )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "Construct> cacheName=" + cattr.getCacheName() );
  -            p( "irca = " + irca.toString() );
  +            log.debug( "Construct> cacheName=" + cattr.getCacheName() );
  +            log.debug( "irca = " + irca.toString() );
           }
           /*
            * TODO
  @@ -197,7 +192,7 @@
                   }
                   catch ( NullPointerException npe )
                   {
  -                    log.error( npe, "npe for ce = " + ce + "ce.attr = " + ce.getAttributes() );
  +                    log.error( "npe for ce = " + ce + "ce.attr = " + ce.getAttributes(), npe );
                       return;
                   }
                   catch ( Exception ex )
  @@ -328,9 +323,9 @@
   
               if ( !this.irca.getGetOnly() )
               {
  -                if ( dbug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "remove> key=" + key );
  +                    log.debug( "remove> key=" + key );
                   }
                   try
                   {
  @@ -389,14 +384,14 @@
           throws IOException
       {
   //    remote.freeCache(cacheName);
  -        p( "disposing of remote cache" );
  +        log.debug( "disposing of remote cache" );
           try
           {
               remote.dispose( cacheName );
           }
           catch ( Exception ex )
           {
  -            p( "couldn't dispose" );
  +            log.error( "couldn't dispose" );
               handleException( ex, "Failed to dispose " + cacheName );
               //remote = null;
           }
  @@ -492,10 +487,10 @@
   
           // initiate failover if local
           RemoteCacheNoWaitFacade rcnwf = ( RemoteCacheNoWaitFacade ) RemoteCacheFactory.facades.get( irca.getCacheName() );
  -        p( "Initiating failover, rcnf = " + rcnwf );
  +        log.debug( "Initiating failover, rcnf = " + rcnwf );
           if ( rcnwf != null && rcnwf.rca.getRemoteType() == rcnwf.rca.LOCAL )
           {
  -            p( "found facade calling failover" );
  +            log.debug( "found facade calling failover" );
               // may need to remove the noWait index here. It will be 0 if it is local
               // since there is only 1 possible listener.
               rcnwf.failover( 0 );
  @@ -506,17 +501,5 @@
               throw ( IOException ) ex;
           }
           throw new IOException( ex.getMessage() );
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        System.out.println( "RemoteCache:" + s + " >" + Thread.currentThread().getName() );
  -        log.debug( "RemoteCache:" + s + " >" + Thread.currentThread().getName() );
       }
   }
  
  
  
  1.4       +18 -32    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheClientTest.java
  
  Index: RemoteCacheClientTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheClientTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteCacheClientTest.java	15 Jan 2002 21:33:32 -0000	1.3
  +++ RemoteCacheClientTest.java	15 Feb 2002 04:33:37 -0000	1.4
  @@ -36,7 +36,7 @@
   
       ICacheObserver watch;
       ICacheService cache;
  -    boolean debug = true;
  +
       /**
        *  The registry host name.
        */
  @@ -142,23 +142,18 @@
               service = REMOTE_CACHE_SERVICE_VAL;
           }
           String registry = "//" + host + ":" + port + "/" + service;
  -        if ( debug )
  -        {
  -            p( "looking up server " + registry );
  -        }
  +
  +        p( "looking up server " + registry );
  +        
           Object obj = Naming.lookup( registry );
   
  -        if ( debug )
  -        {
  -            p( "server found" );
  -        }
  +        p( "server found" );
  +        
           cache = ( ICacheService ) obj;
           watch = ( ICacheObserver ) obj;
   
  -        if ( debug )
  -        {
  -            p( "subscribing to the server" );
  -        }
  +        p( "subscribing to the server" );
  +        
           watch.addCacheListener( "testCache", this );
           ICacheElement cb = new CacheElement( "testCache", "testKey", "testVal" );
   
  @@ -168,18 +163,14 @@
   
               if ( delete )
               {
  -                if ( debug )
  -                {
  -                    p( "deleting a cache item from the server " + i );
  -                }
  +                p( "deleting a cache item from the server " + i );
  +                
                   cache.remove( cb.getCacheName(), cb.getKey() );
               }
               if ( write )
  -            {
  -                if ( debug )
  -                {
  -                    p( "putting a cache bean to the server " + i );
  -                }
  +            {               
  +                p( "putting a cache bean to the server " + i );
  +
                   try
                   {
                       cache.update( cb );
  @@ -261,16 +252,6 @@
        * p("handleRelease>");
        * }
        */
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p( String s )
  -    {
  -        System.out.println( "RemoteCacheClientTest:" + s );
  -    }
  -
   
       /**
        *  The main program for the RemoteCacheClientTest class
  @@ -338,4 +319,9 @@
           return this.listenerId;
       }
   
  +    /** Helper for output, this is an user run test class */
  +    private static void p( String s )
  +    {
  +        System.out.println( s );
  +    }
   }
  
  
  
  1.5       +4 -4      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheFactory.java
  
  Index: RemoteCacheFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RemoteCacheFactory.java	21 Jan 2002 07:00:33 -0000	1.4
  +++ RemoteCacheFactory.java	15 Feb 2002 04:33:37 -0000	1.5
  @@ -12,8 +12,8 @@
   
   import org.apache.stratum.jcs.engine.behavior.ICache;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Description of the Class
  @@ -23,8 +23,8 @@
    */
   public class RemoteCacheFactory implements IAuxiliaryCacheFactory
   {
  -
  -    private static Logger log = LoggerManager.getLogger( RemoteCacheFactory.class );
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteCacheFactory.class );
   
       private static String name;
   
  
  
  
  1.4       +17 -35    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java
  
  Index: RemoteCacheFailoverRunner.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteCacheFailoverRunner.java	15 Jan 2002 21:33:32 -0000	1.3
  +++ RemoteCacheFailoverRunner.java	15 Feb 2002 04:33:37 -0000	1.4
  @@ -2,8 +2,8 @@
   
   import org.apache.stratum.jcs.engine.behavior.ICache;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   //////////////////////////////////////////////////////////////
   /**
  @@ -14,15 +14,14 @@
    */
   public class RemoteCacheFailoverRunner implements Runnable
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteCacheFailoverRunner.class );
  +        
       private RemoteCacheNoWaitFacade facade;
   
       private static long idlePeriod = 20 * 1000;
       private boolean alright = true;
   
  -    private transient Logger log = LoggerManager.getLogger( RemoteCacheFailoverRunner.class );
  -
  -
       //////////////////////////////////////////////
       /**
        *  Constructor for the RemoteCacheFailoverRunner object
  @@ -78,7 +77,7 @@
                * alright = true;
                * }
                */
  -            p( "cache failover running." );
  +            log.debug( "cache failover running." );
   
               // there is no active listener
               if ( !alright )
  @@ -92,12 +91,12 @@
                   // Each RemoteCacheManager corresponds to one remote connection.
                   String[] failovers = facade.rca.getFailovers();
                   int fidx = facade.rca.getFailoverIndex();
  -                p( "fidx = " + fidx + " failovers.length = " + failovers.length );
  +                log.debug( "fidx = " + fidx + " failovers.length = " + failovers.length );
                   int i = fidx + 1;
  -                p( "i = " + i );
  +                log.debug( "i = " + i );
                   for ( ; i < failovers.length; i++ )
                   {
  -                    p( "i = " + i );
  +                    log.debug( "i = " + i );
                       String server = failovers[i];
   
                       RemoteCacheAttributes rca = null;
  @@ -108,7 +107,7 @@
                           rca.setRemoteHost( server.substring( 0, server.indexOf( ":" ) ) );
                           rca.setRemotePort( Integer.parseInt( server.substring( server.indexOf( ":" ) + 1 ) ) );
                           RemoteCacheManager rcm = RemoteCacheManager.getInstance( rca );
  -                        p( "RemoteCacheAttributes for failover = " + rca.toString() );
  +                        log.debug( "RemoteCacheAttributes for failover = " + rca.toString() );
                           // add a listener if there are none, need to tell rca what number it is at
                           ICache ic = rcm.getCache( rca.getCacheName() );
                           if ( ic != null )
  @@ -116,16 +115,16 @@
                               if ( ic.getStatus() == ic.STATUS_ALIVE )
                               {
                                   // may need to do this more gracefully
  -                                p( "reseting no wait" );
  +                                log.debug( "reseting no wait" );
                                   facade.noWaits = new RemoteCacheNoWait[1];
                                   facade.noWaits[0] = ( RemoteCacheNoWait ) ic;
                                   facade.rca.setFailoverIndex( i );
   
                                   synchronized ( this )
                                   {
  -                                    p( "setting ALRIGHT to true, moving to Primary Recovery Mode" );
  +                                    log.debug( "setting ALRIGHT to true, moving to Primary Recovery Mode" );
                                       alright = true;
  -                                    p( "CONNECTED to " + rca.getRemoteHost() + ":" + rca.getRemotePort() + "\n\n" );
  +                                    log.debug( "CONNECTED to " + rca.getRemoteHost() + ":" + rca.getRemotePort() + "\n\n" );
                                   }
   
                               }
  @@ -139,7 +138,7 @@
                       catch ( Exception ex )
                       {
                           bad();
  -                        p( "FAILED to connect to " + rca.getRemoteHost() + ":" + rca.getRemotePort() );
  +                        log.debug( "FAILED to connect to " + rca.getRemoteHost() + ":" + rca.getRemotePort() );
                           // Problem encountered in fixing the caches managed by a RemoteCacheManager instance.
                           // Soldier on to the next RemoteCacheManager instance.
                           log.error( ex.toString() );
  @@ -150,7 +149,6 @@
               // end if !alright
               else
               {
  -                p( "ALRIGHT is true --  failover runner is in primary recovery mode" );
                   log.warn( "ALRIGHT is true --  failover runner is in primary recovery mode" );
               }
   
  @@ -172,7 +170,7 @@
                       if ( ic.getStatus() == ic.STATUS_ALIVE )
                       {
                           // may need to do this more gracefully
  -                        p( "reseting no wait to PRIMARY" );
  +                        log.debug( "reseting no wait to PRIMARY" );
                           facade.noWaits = new RemoteCacheNoWait[1];
                           facade.noWaits[0] = ( RemoteCacheNoWait ) ic;
                           facade.rca.setFailoverIndex( 0 );
  @@ -193,7 +191,7 @@
               // Time driven mode: sleep between each round of recovery attempt.
               try
               {
  -                p( "cache failover runner sleeping for " + idlePeriod );
  +                log.debug( "cache failover runner sleeping for " + idlePeriod );
                   Thread.currentThread().sleep( idlePeriod );
               }
               catch ( InterruptedException ex )
  @@ -204,7 +202,7 @@
               // try to bring the listener back to the primary
           } while ( facade.rca.getFailoverIndex() > 0 );
   
  -        p( "exiting failover runner" );
  +        log.debug( "exiting failover runner" );
           return;
       }
   
  @@ -222,20 +220,4 @@
               }
           }
       }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        if ( log.logLevel >= log.DEBUG )
  -        {
  -            log.debug( s );
  -        }
  -        System.out.println( "RemoteCacheFailoveRunner:" + s );
  -    }
  -
   }
  
  
  
  1.7       +27 -80    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheListener.java
  
  Index: RemoteCacheListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheListener.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RemoteCacheListener.java	21 Jan 2002 22:38:53 -0000	1.6
  +++ RemoteCacheListener.java	15 Feb 2002 04:33:37 -0000	1.7
  @@ -23,8 +23,8 @@
   import org.apache.stratum.jcs.engine.control.CacheManagerFactory;
   import org.apache.stratum.jcs.engine.control.CompositeCacheManager;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /////////////////////////////////////
   
  @@ -38,24 +38,11 @@
    *@author     asmuts
    *@created    January 15, 2002
    */
  -public class RemoteCacheListener implements IRemoteCacheListener, IRemoteCacheConstants, Serializable
  +public class RemoteCacheListener 
  +    implements IRemoteCacheListener, IRemoteCacheConstants, Serializable
   {
  -
  -    /**
  -     *  Description of the Field
  -     */
  -    protected final static boolean debug = false;
  -    //true;
  -    /**
  -     *  Description of the Field
  -     */
  -    protected final static boolean debugcmd = false;
  -    //true;
  -
  -    /**
  -     *  Description of the Field
  -     */
  -    protected static transient Logger log;
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteCacheListener.class );
   
       /**
        *  Description of the Field
  @@ -71,11 +58,6 @@
        */
       protected IRemoteCacheAttributes irca;
   
  -    // TODO: change this log level
  -    /**
  -     *  Description of the Field
  -     */
  -    protected final static boolean debugactivity = true;
       /**
        *  Description of the Field
        */
  @@ -95,11 +77,8 @@
        */
       protected RemoteCacheListener( IRemoteCacheAttributes irca )
       {
  -
           this.irca = irca;
   
  -        log = LoggerManager.getLogger( "remote_remotecachemanager" );
  -
           // may need to add to ICacheManager interface to handle
           // the source arument extended update and remove methods
   
  @@ -143,9 +122,9 @@
           throws IOException
       {
           RemoteCacheInfo.listenerId = id;
  -        if ( debugcmd )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "set listenerId = " + id );
  +            log.debug( "set listenerId = " + id );
           }
       }
   
  @@ -164,9 +143,9 @@
           //getCacheManager();
   
           //p( "get listenerId" );
  -        if ( debugcmd )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "get listenerId = " + RemoteCacheInfo.listenerId );
  +            log.debug( "get listenerId = " + RemoteCacheInfo.listenerId );
           }
           return RemoteCacheInfo.listenerId;
       }
  @@ -182,9 +161,9 @@
       public int getRemoteType()
           throws IOException
       {
  -        if ( debugcmd )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "getRemoteType = " + irca.getRemoteType() );
  +            log.debug( "getRemoteType = " + irca.getRemoteType() );
           }
           return irca.getRemoteType();
       }
  @@ -232,29 +211,22 @@
   
           if ( irca.getRemoveUponRemotePut() )
           {
  -            // for now
  -            //if ( true ) {
  -            if ( debugcmd )
  -            {
  -                p( "PUTTING ELEMENT FROM REMOTE, (  invalidating ) " );
  -            }
  +            log.debug( "PUTTING ELEMENT FROM REMOTE, (  invalidating ) " );
   
               handleRemove( cb.getCacheName(), cb.getKey() );
   
           }
           else
           {
  -            if ( debugcmd )
  -            {
  -                p( "PUTTING ELEMENT FROM REMOTE, ( updating ) " );
  -                p( "cb = " + cb );
  -            }
  -            if ( debugactivity )
  +            if ( log.isDebugEnabled() )
               {
  +                log.debug( "PUTTING ELEMENT FROM REMOTE, ( updating ) " );
  +                log.debug( "cb = " + cb );
  +
                   puts++;
                   if ( puts % 100 == 0 )
                   {
  -                    p( "puts = " + puts );
  +                    log.debug( "puts = " + puts );
                   }
               }
   
  @@ -285,23 +257,16 @@
       public void handleRemove( String cacheName, Serializable key )
           throws IOException
       {
  -        if ( debugactivity )
  +        if ( log.isDebugEnabled() )
           {
               removes++;
               if ( removes % 100 == 0 )
               {
  -                p( "removes = " + removes );
  +                log.debug( "removes = " + removes );
               }
  -        }
   
  -        if ( debug )
  -        {
               log.debug( "handleRemove> cacheName=" + cacheName + ", key=" + key );
           }
  -        if ( debugcmd )
  -        {
  -            p( "handleRemove> cacheName=" + cacheName + ", key=" + key );
  -        }
   
           getCacheManager();
           Cache cache = ( Cache ) cacheMgr.getCache( cacheName );
  @@ -331,7 +296,7 @@
       public void handleRemoveAll( String cacheName )
           throws IOException
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "handleRemoveAll> cacheName=" + cacheName );
           }
  @@ -351,7 +316,7 @@
       public void handleDispose( String cacheName )
           throws IOException
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "handleDispose> cacheName=" + cacheName );
           }
  @@ -370,36 +335,18 @@
           if ( cacheMgr == null )
           {
               cacheMgr = ( ICompositeCacheManager ) CacheManagerFactory.getInstance();
  -            p( "had to get cacheMgr" );
  -            if ( debugcmd )
  +            log.debug( "had to get cacheMgr" );
  +            if ( log.isDebugEnabled() )
               {
  -                p( "cacheMgr = " + cacheMgr );
  +                log.debug( "cacheMgr = " + cacheMgr );
               }
           }
           else
           {
  -            if ( debugcmd )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "already got cacheMgr = " + cacheMgr );
  +                log.debug( "already got cacheMgr = " + cacheMgr );
               }
           }
       }
  -
  -
  -    //////////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    public static void p( String s )
  -    {
  -        if ( log.logLevel >= log.DEBUG )
  -        {
  -            log.debug( "RemoteCacheListener: " + s );
  -        }
  -        System.out.println( "RemoteCacheListener: " + s );
  -    }
  -
   }
  -// end class
  
  
  
  1.4       +15 -29    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheManager.java
  
  Index: RemoteCacheManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteCacheManager.java	15 Jan 2002 21:33:32 -0000	1.3
  +++ RemoteCacheManager.java	15 Feb 2002 04:33:37 -0000	1.4
  @@ -29,8 +29,8 @@
   
   import org.apache.stratum.jcs.engine.CacheWatchRepairable;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  An instance of RemoteCacheManager corresponds to one remote connection of a
  @@ -43,15 +43,14 @@
    */
   public class RemoteCacheManager implements IAuxiliaryCacheManager
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteCacheManager.class );
  +        
       // Contains mappings of Location instance to RemoteCacheManager instance.
       final static Map instances = new HashMap();
       private static RemoteCacheMonitor monitor;
  -    private static boolean debug = false;
  -    //true;         //true;
   
       private int clients;
  -    private Logger log;
   
       // Contains instances of RemoteCacheNoWait managed by an RemoteCacheManager instance.
       final Map caches = new HashMap();
  @@ -88,18 +87,18 @@
           this.host = host;
           this.port = port;
           this.service = service;
  -        log = LoggerManager.getLogger( this );
  +
           String registry = "//" + host + ":" + port + "/" + service;
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "looking up server " + registry );
  +            log.debug( "looking up server " + registry );
           }
           try
           {
               Object obj = Naming.lookup( registry );
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "server found" );
  +                log.debug( "server found" );
               }
               // Successful connection to the remote server.
               remoteService = ( IRemoteCacheService ) obj;
  @@ -193,9 +192,9 @@
                   }
               }
           }
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            ins.log.logIt( "Manager stats : " + ins.getStats() + "<br> -- in getInstance()" );
  +            ins.log.debug( "Manager stats : " + ins.getStats() + "-- in getInstance()" );
           }
           ins.clients++;
           // Fires up the monitoring daemon.
  @@ -252,9 +251,9 @@
                   caches.put( cattr.getCacheName(), c );
               }
           }
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            log.logIt( "Manager stats : " + getStats() );
  +            log.debug( "Manager stats : " + getStats() );
           }
           //if ( irca.getUseRemote() ) {
           try
  @@ -351,8 +350,7 @@
                       }
                       catch ( IOException ex )
                       {
  -                        ex.printStackTrace();
  -                        log.logEx( ex );
  +                        log.error( ex );
                       }
                   }
               }
  @@ -378,18 +376,6 @@
                   cache.fixCache( this.remoteService );
               }
           }
  -    }
  -
  -
  -    /////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        log.debug( "RemoteCacheManager:" + s );
       }
   
   
  
  
  
  1.4       +7 -21     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheMonitor.java
  
  Index: RemoteCacheMonitor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheMonitor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteCacheMonitor.java	15 Jan 2002 21:33:32 -0000	1.3
  +++ RemoteCacheMonitor.java	15 Feb 2002 04:33:37 -0000	1.4
  @@ -6,8 +6,8 @@
   import org.apache.stratum.jcs.auxiliary.remote.RemoteCacheNoWait;
   import org.apache.stratum.jcs.auxiliary.remote.RemoteCacheRestore;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Used to monitor and repair any failed connection for the remote cache
  @@ -23,12 +23,13 @@
    */
   public class RemoteCacheMonitor implements Runnable
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteCacheMonitor.class );
  +        
       private static RemoteCacheMonitor instance;
       private static long idlePeriod = 30 * 1000;
       // minimum 30 seconds.
       //private static long idlePeriod = 3*1000; // for debugging.
  -    private transient Logger log = LoggerManager.getInstance().getLogger( this );
   
       // Must make sure RemoteCacheMonitor is started before any remote error can be detected!
       private boolean alright = true;
  @@ -85,7 +86,7 @@
        */
       public void notifyError()
       {
  -        p( "Notified of an error." );
  +        log.debug( "Notified of an error." );
           bad();
           synchronized ( this )
           {
  @@ -103,7 +104,7 @@
        */
       public void run()
       {
  -        p( "Monitoring daemon started" );
  +        log.debug( "Monitoring daemon started" );
           do
           {
   
  @@ -208,21 +209,6 @@
                   alright = false;
               }
           }
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        if ( log.logLevel >= log.DEBUG )
  -        {
  -            log.debug( s );
  -        }
  -        System.out.println( "RemoteCacheMonitor:" + s );
       }
   }
   
  
  
  
  1.4       +7 -17     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheNoWait.java
  
  Index: RemoteCacheNoWait.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheNoWait.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteCacheNoWait.java	15 Jan 2002 21:33:32 -0000	1.3
  +++ RemoteCacheNoWait.java	15 Feb 2002 04:33:37 -0000	1.4
  @@ -17,8 +17,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICacheEventQueue;
   import org.apache.stratum.jcs.engine.behavior.ICacheType;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Used to queue up update requests to the underlying cache. These requests
  @@ -30,10 +30,11 @@
    */
   public class RemoteCacheNoWait implements ICache
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteCacheNoWait.class );
  +        
       private final RemoteCache cache;
       private ICacheEventQueue q;
  -    private transient Logger log = LoggerManager.getInstance().getLogger( this );
   
       private String source_id = "org.apache.stratum.jcs.auxiliary.remote.RemoteCacheNoWait";
   
  @@ -160,14 +161,14 @@
           }
           catch ( UnmarshalException ue )
           {
  -            p( "Retrying the get owing to UnmarshalException..." );
  +            log.debug( "Retrying the get owing to UnmarshalException..." );
               try
               {
                   return cache.get( key );
               }
               catch ( IOException ex )
               {
  -                p( "Failed in retrying the get for the second time." );
  +                log.debug( "Failed in retrying the get for the second time." );
                   q.destroy();
               }
           }
  @@ -336,16 +337,5 @@
       public String toString()
       {
           return "RemoteCacheNoWait: " + cache.toString();
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        System.out.println( "RemoteCacheNoWait:" + s );
       }
   }
  
  
  
  1.4       +12 -33    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java
  
  Index: RemoteCacheNoWaitFacade.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheNoWaitFacade.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteCacheNoWaitFacade.java	15 Jan 2002 21:33:32 -0000	1.3
  +++ RemoteCacheNoWaitFacade.java	15 Feb 2002 04:33:37 -0000	1.4
  @@ -10,8 +10,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   import org.apache.stratum.jcs.engine.behavior.ICacheType;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Used to provide access to multiple services under nowait protection. factory
  @@ -23,16 +23,11 @@
    */
   public class RemoteCacheNoWaitFacade implements ICache
   {
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteCacheNoWaitFacade.class );
   
  -    private final static boolean debug = false;
  -    // true;
  -    private final static boolean debugF = true;
  -
  -    /**
  -     *  Description of the Field
  -     */
       public RemoteCacheNoWait[] noWaits;
  -    private transient Logger log = LoggerManager.getInstance().getLogger( this );
  +
       private String source_id = "org.apache.stratum.jcs.auxiliary.remote.RemoteCacheNoWaitFacade";
   
       private String cacheName;
  @@ -88,9 +83,9 @@
       //public RemoteCacheNoWaitFacade(RemoteCacheNoWait[] noWaits, String cacheName) {
       public RemoteCacheNoWaitFacade( RemoteCacheNoWait[] noWaits, RemoteCacheAttributes rca )
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "CONSTRUCTING NO WAIT FACADE" );
  +            log.debug( "CONSTRUCTING NO WAIT FACADE" );
           }
           this.noWaits = noWaits;
           this.rca = rca;
  @@ -145,9 +140,9 @@
       public void update( ICacheElement ce )
           throws IOException
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "updating through cache facade, noWaits.length = " + noWaits.length );
  +            log.debug( "updating through cache facade, noWaits.length = " + noWaits.length );
           }
           int i = 0;
           try
  @@ -209,7 +204,7 @@
               }
               catch ( Exception ex )
               {
  -                p( "Failed to get." );
  +                log.debug( "Failed to get." );
               }
               return null;
           }
  @@ -350,18 +345,6 @@
           return "RemoteCacheNoWaitFacade: " + cacheName + ", rca = " + rca;
       }
   
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        System.out.println( "RemoteCacheNoWaitFacade:" + s );
  -    }
  -
  -
       /////////////////////////////////////////
       /**
        *  Description of the Method
  @@ -371,9 +354,9 @@
       protected void failover( int i )
       {
   
  -        if ( debugF )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "in failover for " + i );
  +            log.debug( "in failover for " + i );
           }
           //if ( noWaits.length == 1 ) {
           if ( rca.getRemoteType() == rca.LOCAL )
  @@ -393,10 +376,6 @@
               }
               else
               {
  -                if ( debugF )
  -                {
  -                    p( "the noWait is not in error" );
  -                }
                   log.info( "the noWait is not in error" );
               }
           }
  
  
  
  1.4       +5 -18     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheRestore.java
  
  Index: RemoteCacheRestore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteCacheRestore.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteCacheRestore.java	15 Jan 2002 21:33:32 -0000	1.3
  +++ RemoteCacheRestore.java	15 Feb 2002 04:33:37 -0000	1.4
  @@ -8,8 +8,8 @@
   
   import org.apache.stratum.jcs.engine.behavior.ICacheRestore;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Used to repair the remote caches managed by the associated instance of
  @@ -25,10 +25,9 @@
    */
   public class RemoteCacheRestore implements ICacheRestore
   {
  -
  -    private Logger log = LoggerManager.getLogger( this );
  -
  -    private boolean debug = true;
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteCacheRestore.class );
  +        
       private final RemoteCacheManager rcm;
       //private final IAuxiliaryCacheManager rcm;
       private boolean canFix = true;
  @@ -89,17 +88,5 @@
           rcm.fixCaches( ( IRemoteCacheService ) remoteObj, ( IRemoteCacheObserver ) remoteObj );
           String msg = "Remote connection to " + "//" + rcm.host + ":" + rcm.port + "/" + rcm.service + " resumed.";
           log.info( msg );
  -        p( msg );
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        System.out.println( "RemoteCacheRestore:" + s );
       }
   }
  
  
  
  1.4       +10 -18    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteUtils.java
  
  Index: RemoteUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/RemoteUtils.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteUtils.java	15 Jan 2002 21:33:32 -0000	1.3
  +++ RemoteUtils.java	15 Feb 2002 04:33:37 -0000	1.4
  @@ -12,6 +12,9 @@
   
   import java.util.Properties;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
  +
   /**
    *  Description of the Class
    *
  @@ -20,9 +23,9 @@
    */
   public class RemoteUtils
   {
  -    private static boolean debug = false;
  -
  -
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteUtils.class );
  +    
       /**
        *  Constructor for the RemoteUtils object
        */
  @@ -39,13 +42,13 @@
       public static int createRegistry( int port )
           throws RemoteException
       {
  -        p( "createRegistry> setting security manager" );
  +        log.debug( "createRegistry> setting security manager" );
           System.setSecurityManager( new RMISecurityManager() );
           if ( port < 1024 )
           {
               port = Registry.REGISTRY_PORT;
           }
  -        p( "createRegistry> creating registry" );
  +        log.debug( "createRegistry> creating registry" );
           LocateRegistry.createRegistry( port );
           return port;
       }
  @@ -66,9 +69,9 @@
           try
           {
               props.load( is );
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "props.size=" + props.size() + ", " + props );
  +                log.debug( "props.size=" + props.size() + ", " + props );
               }
           }
           catch ( Exception ex )
  @@ -83,17 +86,6 @@
               }
           }
           return props;
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p( String s )
  -    {
  -        System.out.println( "RmiUitls: " + s );
       }
   }
   
  
  
  
  1.5       +24 -29    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/group/RemoteGroupCacheListener.java
  
  Index: RemoteGroupCacheListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/group/RemoteGroupCacheListener.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RemoteGroupCacheListener.java	17 Jan 2002 00:19:37 -0000	1.4
  +++ RemoteGroupCacheListener.java	15 Feb 2002 04:33:38 -0000	1.5
  @@ -27,6 +27,9 @@
   import org.apache.stratum.jcs.engine.group.GroupCacheManager;
   import org.apache.stratum.jcs.engine.group.GroupCacheManagerFactory;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
  +
   /////////////////////////////////////
   
   // remove
  @@ -40,8 +43,9 @@
    */
   public class RemoteGroupCacheListener extends RemoteCacheListener implements IRemoteCacheListener, IRemoteCacheConstants, Serializable
   {
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteGroupCacheListener.class );
   
  -    ///////////////////////////////////////////
       /**
        *  Constructor for the RemoteGroupCacheListener object
        *
  @@ -50,7 +54,7 @@
       protected RemoteGroupCacheListener( IRemoteCacheAttributes irca )
       {
           super( irca );
  -        p( "creating RemoteGroupCacheListener" );
  +        log.debug( "creating RemoteGroupCacheListener" );
       }
   
   
  @@ -111,45 +115,36 @@
   
                   if ( irca.getRemoveUponRemotePut() )
                   {
  -
  -                    if ( debugcmd )
  -                    {
  -                        p( "PUTTING ELEMENT FROM REMOTE, (  invalidating ) " );
  -                    }
  +                    log.debug( "PUTTING ELEMENT FROM REMOTE, (  invalidating ) " );
   
                       // remove the item
                       handleRemove( cb.getCacheName(), cb.getKey() );
   
                       // add the key to the attrNameSet
  -                    if ( debugcmd )
  -                    {
  -                        p( "Adding to attrNameSet " );
  -                    }
  +
  +                    log.debug( "Adding to attrNameSet " );
  +                    
                       getCacheManager();
                       GroupCache cache = ( GroupCache ) cacheMgr.getCache( cb.getCacheName() );
  -                    if ( debugcmd )
  +                    if ( log.isDebugEnabled() )
                       {
  -                        p( "cache = " + cache );
  +                        log.debug( "cache = " + cache );
                       }
                       cache.updateGroupAttrNameSet( ( GroupAttrName ) cb.getKey(), ICache.REMOTE_INVOKATION, false );
  -                    if ( debugcmd )
  -                    {
  -                        p( "Adding to attrNameSet " );
  -                    }
  +
  +                    log.debug( "Adding to attrNameSet " );
                   }
                   else
                   {
  -                    if ( debugcmd )
  -                    {
  -                        p( "PUTTING ELEMENT FROM REMOTE, ( updating ) " );
  -                        p( "cb = " + cb );
  -                    }
  -                    if ( debugactivity )
  +                    if ( log.isDebugEnabled() )
                       {
  +                        log.debug( "PUTTING ELEMENT FROM REMOTE, ( updating ) " );
  +                        log.debug( "cb = " + cb );
  +
                           puts++;
                           if ( puts % 100 == 0 )
                           {
  -                            p( "puts = " + puts );
  +                            log.debug( "puts = " + puts );
                           }
                       }
   
  @@ -187,7 +182,7 @@
        * / could put this in the group cache.
        * if (cb.getKey() instanceof GroupAttrName) {
        * try {
  -     * if ( debug ) {
  +     * if ( log.isDebugEnabled() ) {
        * p( "removing gi for ga method" );
        * }
        * GroupAttrName gan = (GroupAttrName)cb.getKey();
  @@ -230,16 +225,16 @@
               if ( cacheMgr == null )
               {
                   cacheMgr = ( ICompositeCacheManager ) GroupCacheManagerFactory.getInstance();
  -                if ( debugcmd )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( " groupcache cacheMgr = " + cacheMgr );
  +                    log.debug( " groupcache cacheMgr = " + cacheMgr );
                   }
               }
               else
               {
  -                if ( debugcmd )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "already got groupcache cacheMgr = " + cacheMgr );
  +                    log.debug( "already got groupcache cacheMgr = " + cacheMgr );
                   }
               }
           }
  
  
  
  1.4       +5 -6      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/RemoteCacheClusterFactory.java
  
  Index: RemoteCacheClusterFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/RemoteCacheClusterFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteCacheClusterFactory.java	15 Jan 2002 21:33:33 -0000	1.3
  +++ RemoteCacheClusterFactory.java	15 Feb 2002 04:33:38 -0000	1.4
  @@ -16,8 +16,8 @@
   
   import org.apache.stratum.jcs.engine.behavior.ICache;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Description of the Class
  @@ -27,11 +27,10 @@
    */
   public class RemoteCacheClusterFactory implements IAuxiliaryCacheFactory
   {
  -
  -    private static Logger log = LoggerManager.getLogger( RemoteCacheFactory.class );
  -
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteCacheClusterFactory.class );
  +        
       private static String name;
  -
   
       ///////////////////////////////////
       /**
  
  
  
  1.4       +15 -30    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/RemoteCacheClusterManager.java
  
  Index: RemoteCacheClusterManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/RemoteCacheClusterManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteCacheClusterManager.java	15 Jan 2002 21:33:33 -0000	1.3
  +++ RemoteCacheClusterManager.java	15 Feb 2002 04:33:38 -0000	1.4
  @@ -26,8 +26,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICache;
   import org.apache.stratum.jcs.engine.behavior.ICacheManager;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *@author     asmuts
  @@ -35,15 +35,14 @@
    */
   public class RemoteCacheClusterManager implements ICacheManager
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteCacheClusterManager.class );
  +        
       // Contains mappings of Location instance to RemoteCacheManager instance.
       final static Map instances = new HashMap();
       private static RemoteCacheClusterMonitor monitor;
  -    private static boolean debug = true;
  -    //true;
   
       private int clients;
  -    private static Logger log = LoggerManager.getLogger( RemoteCacheClusterManager.class );
   
       // Contains instances of RemoteCacheNoWait managed by an RemoteCacheManager instance.
       final Map caches = new HashMap();
  @@ -82,18 +81,18 @@
           this.host = host;
           this.port = port;
           this.service = service;
  -        //log = LoggerManager.getLogger(this);
  +
           String registry = "//" + host + ":" + port + "/" + service;
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "looking up server " + registry );
  +            log.debug( "looking up server " + registry );
           }
           try
           {
               Object obj = Naming.lookup( registry );
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "server found" );
  +                log.debug( "server found" );
               }
               // Successful connection to the remote server.
               remoteService = ( IRemoteCacheService ) obj;
  @@ -205,9 +204,9 @@
               }
   
           }
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            ins.log.logIt( "Manager stats : " + ins.getStats() + "<br> -- in getInstance()" );
  +            log.debug( "Manager stats : " + ins.getStats() + "-- in getInstance()" );
           }
           ins.clients++;
           // Fires up the monitoring daemon.
  @@ -277,9 +276,9 @@
                   caches.put( cattr.getCacheName(), c );
               }
           }
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            log.logIt( "Manager stats : " + getStats() );
  +            log.debug( "Manager stats : " + getStats() );
           }
           //if ( irca.getUseRemote() ) {
           try
  @@ -370,8 +369,7 @@
                       }
                       catch ( IOException ex )
                       {
  -                        ex.printStackTrace();
  -                        log.logEx( ex );
  +                        log.error( ex );
                       }
                   }
               }
  @@ -398,19 +396,6 @@
               }
           }
       }
  -
  -
  -    /////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        log.debug( "RemoteCacheManager:" + s );
  -    }
  -
   
       ///////////////////////////////////////
       /**
  
  
  
  1.4       +5 -15     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/RemoteCacheClusterMonitor.java
  
  Index: RemoteCacheClusterMonitor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/RemoteCacheClusterMonitor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteCacheClusterMonitor.java	15 Jan 2002 21:33:33 -0000	1.3
  +++ RemoteCacheClusterMonitor.java	15 Feb 2002 04:33:38 -0000	1.4
  @@ -7,8 +7,8 @@
   import org.apache.stratum.jcs.auxiliary.remote.server.RemoteCacheClusterManager;
   import org.apache.stratum.jcs.auxiliary.remote.server.RemoteCacheClusterRestore;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Used to monitor and repair any failed connection for the remote cache
  @@ -24,12 +24,13 @@
    */
   public class RemoteCacheClusterMonitor implements Runnable
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteCacheClusterMonitor.class );
  +        
       private static RemoteCacheClusterMonitor instance;
       private static long idlePeriod = 30 * 1000;
       // minimum 30 seconds.
       //private static long idlePeriod = 3*1000; // for debugging.
  -    private transient Logger log = LoggerManager.getInstance().getLogger( this );
   
       // Must make sure RemoteCacheMonitor is started before any remote error can be detected!
       private boolean alright = true;
  @@ -192,17 +193,6 @@
                   alright = false;
               }
           }
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        System.out.println( "RemoteCacheClusterMonitor:" + s );
       }
   }
   
  
  
  
  1.4       +6 -19     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/RemoteCacheClusterRestore.java
  
  Index: RemoteCacheClusterRestore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/RemoteCacheClusterRestore.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteCacheClusterRestore.java	15 Jan 2002 21:33:33 -0000	1.3
  +++ RemoteCacheClusterRestore.java	15 Feb 2002 04:33:38 -0000	1.4
  @@ -8,8 +8,8 @@
   
   import org.apache.stratum.jcs.engine.behavior.ICacheRestore;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   // may not be necessary.  cloning the remote cache framework for the cluster
   // connections.  may be able to use old, but it is probably better to move away
  @@ -27,10 +27,9 @@
    */
   public class RemoteCacheClusterRestore implements ICacheRestore
   {
  -
  -    private Logger log = LoggerManager.getLogger( this );
  -
  -    private boolean debug = true;
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteCacheClusterRestore.class );
  +        
       private final RemoteCacheClusterManager rcm;
       //private final IAuxiliaryCacheManager rcm;
       private boolean canFix = true;
  @@ -71,7 +70,7 @@
           }
           catch ( Exception ex )
           {
  -            log.error( ex, "host=" + rcm.host + "; port" + rcm.port + "; service=" + rcm.service );
  +            log.error( "host=" + rcm.host + "; port" + rcm.port + "; service=" + rcm.service, ex );
               canFix = false;
           }
           return canFix;
  @@ -90,17 +89,5 @@
           rcm.fixCaches( ( IRemoteCacheService ) remoteObj, ( IRemoteCacheObserver ) remoteObj );
           String msg = "Remote connection to " + "//" + rcm.host + ":" + rcm.port + "/" + rcm.service + " resumed.";
           log.info( msg );
  -        p( msg );
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        System.out.println( "RemoteCacheRestore:" + s );
       }
   }
  
  
  
  1.7       +37 -73    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/RemoteCacheServer.java
  
  Index: RemoteCacheServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/RemoteCacheServer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RemoteCacheServer.java	22 Jan 2002 05:31:41 -0000	1.6
  +++ RemoteCacheServer.java	15 Feb 2002 04:33:38 -0000	1.7
  @@ -37,8 +37,8 @@
   import org.apache.stratum.jcs.engine.control.CacheManagerFactory;
   import org.apache.stratum.jcs.engine.control.CompositeCacheManager;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Provides remote cache services.
  @@ -46,14 +46,13 @@
    *@author     asmuts
    *@created    January 15, 2002
    */
  -public class RemoteCacheServer extends UnicastRemoteObject
  -     implements IRemoteCacheService, IRemoteCacheObserver, IRemoteCacheServiceAdmin, Unreferenced
  +public class RemoteCacheServer 
  +    extends UnicastRemoteObject
  +    implements IRemoteCacheService, IRemoteCacheObserver, 
  +               IRemoteCacheServiceAdmin, Unreferenced
   {
  -    ///////////////// debug must be set to false in production! ////////////////
  -    /**
  -     *  Description of the Field
  -     */
  -    protected final static boolean debug = false;
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteCacheServer.class );
   
       /**
        *  Description of the Field
  @@ -67,12 +66,7 @@
       public String className;
   
       private int puts = 0;
  -    /**
  -     *  Description of the Field
  -     */
  -    protected final static boolean debugactivity = true;
   
  -    private transient Logger log;
       // Maps cache name to CacheListeners object.
       // association of listeners (regions).
       private final Hashtable cacheListenersMap = new Hashtable();
  @@ -124,7 +118,6 @@
           int idx = s.lastIndexOf( "." );
           this.className = s.substring( idx + 1 );
   
  -        log = LoggerManager.getLogger( this );
           cacheManager = createCacheManager( prop );
   
           // cacheManager would have created a number of ICache objects.
  @@ -264,7 +257,7 @@
               start = System.currentTimeMillis();
           }
   
  -        if ( debugactivity )
  +        if ( log.isDebugEnabled() )
           {
               puts++;
               if ( puts % 100 == 0 )
  @@ -273,21 +266,11 @@
               }
           }
   
  -        if ( debug )
  -        {
  -            if ( debug )
  -            {
  -                p( "in update, put " + item.getKey() + " in " + item.getCacheName() );
  -            }
  -        }
  -        if ( log.logLevel >= log.INFO )
  +        if ( log.isDebugEnabled() )
           {
  -            log.info( "in update, put " + item.getKey() );
  -            if ( log.logLevel >= log.DEBUG )
  -            {
  -                log.debug( "item = " + item );
  -            }
  +            log.debug( "in update, put " + item.getKey() + " in " + item.getCacheName() );
           }
  +
           try
           {
               CacheListeners cacheDesc = getCacheListeners( item.getCacheName() );
  @@ -320,17 +303,17 @@
                       // WILL TRY UPDATING REMOTES
                       if ( fromCluster )
                       {
  -                        if ( debug )
  +                        if ( log.isDebugEnabled() )
                           {
  -                            p( "not updating clusters **************************************" );
  +                            log.debug( "not updating clusters **************************************" );
                           }
                           c.update( item, ICache.REMOTE_INVOKATION );
                       }
                       else
                       {
  -                        if ( debug )
  +                        if ( log.isDebugEnabled() )
                           {
  -                            p( "updating clusters **************************************" );
  +                            log.debug( "updating clusters **************************************" );
                           }
                           c.update( item, ICache.LOCAL_INVOKATION );
                       }
  @@ -452,9 +435,9 @@
       public Serializable get( String cacheName, Serializable key, boolean container )
           throws IOException
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "get " + key + " from cache " + cacheName );
  +            log.debug( "get " + key + " from cache " + cacheName );
           }
   
   //        Integer remoteTypeL = ( Integer ) idTypeMap.get( new Byte( requesterId ) );
  @@ -525,9 +508,9 @@
       public void remove( String cacheName, Serializable key, byte requesterId )
           throws IOException
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "remove " + key + " from cache " + cacheName );
  +            log.debug( "remove " + key + " from cache " + cacheName );
           }
           CacheListeners cacheDesc = ( CacheListeners ) cacheListenersMap.get( cacheName );
   
  @@ -551,17 +534,17 @@
   
                   if ( fromCluster )
                   {
  -                    if ( debug )
  +                    if ( log.isDebugEnabled() )
                       {
  -                        p( "not updating clusters **************************************" );
  +                        log.debug( "not updating clusters **************************************" );
                       }
                       removeSuccess = c.remove( key, ICache.REMOTE_INVOKATION );
                   }
                   else
                   {
  -                    if ( debug )
  +                    if ( log.isDebugEnabled() )
                       {
  -                        p( "updating clusters **************************************" );
  +                        log.debug( "updating clusters **************************************" );
                       }
                       removeSuccess = c.remove( key, ICache.LOCAL_INVOKATION );
                   }
  @@ -772,12 +755,12 @@
               int remoteType = ircl.getRemoteType();
               if ( remoteType == IRemoteCacheAttributes.CLUSTER )
               {
  -                p( "adding cluster listener" );
  +                log.debug( "adding cluster listener" );
                   cacheDesc = getClusterListeners( cacheName );
               }
               else
               {
  -                p( "adding normal listener" );
  +                log.debug( "adding normal listener" );
                   cacheDesc = getCacheListeners( cacheName );
               }
               Map eventQMap = cacheDesc.eventQMap;
  @@ -793,7 +776,7 @@
                       {
                           // must start at one so the next gets recognized
                           byte listenerIdB = nextListenerId();
  -                        if ( log.DEBUG <= log.logLevel )
  +                        if ( log.isDebugEnabled() )
                           {
                               log.debug( "listener id=" + ( listenerIdB & 0xff ) + " addded for cache " + cacheName );
                           }
  @@ -817,9 +800,9 @@
                   //eventQMap.put(listener, new CacheEventQueue(listener, getRequester(), cacheName));
                   eventQMap.put( listener, new CacheEventQueue( listener, id, cacheName ) );
   
  -                if ( debug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "****** Cache " + cacheName + "'s listener size=" + cacheDesc.eventQMap.size() );
  +                    log.debug( "****** Cache " + cacheName + "'s listener size=" + cacheDesc.eventQMap.size() );
                   }
               }
               // end sync
  @@ -848,9 +831,9 @@
               String cacheName = ( String ) en.nextElement();
               addCacheListener( cacheName, listener );
   
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "adding listener for cache " + cacheName );
  +                log.debug( "adding listener for cache " + cacheName );
               }
           }
           return;
  @@ -878,9 +861,9 @@
               {
                   q.destroy();
               }
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "****** Cache " + cacheName + "'s listener size=" + cacheDesc.eventQMap.size() );
  +                log.debug( "****** Cache " + cacheName + "'s listener size=" + cacheDesc.eventQMap.size() );
               }
           }
           catch ( NotBoundException ex )
  @@ -905,9 +888,9 @@
               String cacheName = ( String ) en.nextElement();
               removeCacheListener( cacheName, listener );
   
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "removing listener for cache " + cacheName );
  +                log.debug( "removing listener for cache " + cacheName );
               }
           }
           return;
  @@ -937,7 +920,7 @@
       public void shutdown( String host, int port )
           throws IOException
       {
  -        p( "received shutdown request" );
  +        log.debug( "received shutdown request" );
           RemoteCacheServerFactory.shutdownImpl( host, port );
       }
   
  @@ -951,7 +934,7 @@
       // TODO: test out the DGC.
       public void unreferenced()
       {
  -        p( "*** Warning: Server now unreferenced and subject to GC. ***" );
  +        log.debug( "*** Warning: Server now unreferenced and subject to GC. ***" );
       }
   
   
  @@ -1008,24 +991,5 @@
       private static void p1( String s )
       {
           System.out.println( "RemoteCacheServer:" + s + " >" + Thread.currentThread().getName() );
  -    }
  -
  -
  -    //////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    protected void p( String s )
  -    {
  -        if ( debug )
  -        {
  -            System.out.println( "RemoteCacheServer:" + s + " >" + Thread.currentThread().getName() );
  -        }
  -        else
  -        {
  -            log.debug( "RemoteCacheServer:" + s + " >" + Thread.currentThread().getName() );
  -        }
       }
   }
  
  
  
  1.5       +19 -30    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java
  
  Index: RemoteCacheServerFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RemoteCacheServerFactory.java	21 Jan 2002 22:38:53 -0000	1.4
  +++ RemoteCacheServerFactory.java	15 Feb 2002 04:33:38 -0000	1.5
  @@ -18,6 +18,9 @@
   
   import org.apache.stratum.jcs.engine.behavior.ICacheServiceAdmin;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
  +
   /**
    *  Provides remote cache services.
    *
  @@ -26,15 +29,15 @@
    */
   public class RemoteCacheServerFactory
        implements IRemoteCacheConstants
  -{
  +{    
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteCacheServerFactory.class );
   
       /**
        *  The single instance of the RemoteCacheServer object.
        */
       private static RemoteCacheServer instance;
       private static String serviceName;
  -    static boolean debug = false;
  -
   
       /**
        *  Constructor for the RemoteCacheServerFactory object
  @@ -81,11 +84,11 @@
                   servicePort = Integer.parseInt( servicePortStr );
   
                   rcsa.setServicePort( servicePort );
  -                p( "Remote cache service uses port number " + servicePort + "." );
  +                log.debug( "Remote cache service uses port number " + servicePort + "." );
               }
               catch ( NumberFormatException ignore )
               {
  -                p( "Remote cache service port property " + REMOTE_CACHE_SERVICE_PORT + " not specified.  An anonymous port will be used." );
  +                log.debug( "Remote cache service port property " + REMOTE_CACHE_SERVICE_PORT + " not specified.  An anonymous port will be used." );
               }
   
               String lccStr = prop.getProperty( REMOTE_LOCAL_CLUSTER_CONSISTENCY );
  @@ -114,7 +117,7 @@
               }
               // Register the RemoteCacheServer remote object in the registry.
               serviceName = prop.getProperty( REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_VAL ).trim();
  -            p( "main> binding server to " + host + ":" + port + " with the name " +
  +            log.debug( "main> binding server to " + host + ":" + port + " with the name " +
                   serviceName );
               try
               {
  @@ -150,7 +153,7 @@
               {
                   return;
               }
  -            p( "Unbinding host=" + host + ", port=" + port + ", serviceName=" + serviceName );
  +            log.debug( "Unbinding host=" + host + ", port=" + port + ", serviceName=" + serviceName );
               try
               {
                   Naming.unbind( "//" + host + ":" + port + "/" + serviceName );
  @@ -198,14 +201,14 @@
               String serviceName = prop.getProperty( REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_VAL ).trim();
               String registry = "//:" + Registry.REGISTRY_PORT + "/" + serviceName;
   
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "looking up server " + registry );
  +                log.debug( "looking up server " + registry );
               }
               Object obj = Naming.lookup( registry );
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "server found" );
  +                log.debug( "server found" );
               }
               ICacheServiceAdmin admin = ( ICacheServiceAdmin ) obj;
               try
  @@ -214,10 +217,9 @@
               }
               catch ( Exception ex )
               {
  -                p( ex.toString() );
  -                ex.printStackTrace( System.out );
  +                log.error( ex );
               }
  -            p( "done." );
  +            log.debug( "done." );
               System.exit( 0 );
           }
   
  @@ -235,25 +237,12 @@
   
           if ( host == null || host.trim().equals( "" ) || host.trim().equals( "localhost" ) )
           {
  -            p( "main> creating registry on the localhost" );
  +            log.debug( "main> creating registry on the localhost" );
               port = RemoteUtils.createRegistry( port );
           }
  -        p( "main> starting up RemoteCacheServer" );
  +        log.debug( "main> starting up RemoteCacheServer" );
           RemoteCacheServerFactory.startup( host, port, args.length > 0 ? args[0] : null );
  -        p( "main> done" );
  -
  -    }
  -    // end main
  -
  -    ////////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p( String s )
  -    {
  -        System.out.println( "RemoteCacheServerFactory:" + s + " >" + Thread.currentThread().getName() );
  +        log.debug( "main> done" );
       }
   }
   
  
  
  
  1.4       +24 -57    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/RemoteCacheServerListener.java
  
  Index: RemoteCacheServerListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/RemoteCacheServerListener.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RemoteCacheServerListener.java	15 Jan 2002 21:33:33 -0000	1.3
  +++ RemoteCacheServerListener.java	15 Feb 2002 04:33:38 -0000	1.4
  @@ -23,8 +23,8 @@
   import org.apache.stratum.jcs.engine.control.CacheManagerFactory;
   import org.apache.stratum.jcs.engine.control.CompositeCacheManager;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /////////////////////////////////////
   
  @@ -37,22 +37,11 @@
    *@author     asmuts
    *@created    January 15, 2002
    */
  -public class RemoteCacheServerListener implements IRemoteCacheListener, IRemoteCacheConstants, Serializable
  +public class RemoteCacheServerListener 
  +    implements IRemoteCacheListener, IRemoteCacheConstants, Serializable
   {
  -
  -    /**
  -     *  Description of the Field
  -     */
  -    protected final static boolean debug = true;
  -    /**
  -     *  Description of the Field
  -     */
  -    protected final static boolean debugcmd = true;
  -
  -    /**
  -     *  Description of the Field
  -     */
  -    protected static transient Logger log;
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteCacheServerListener.class );
   
       /**
        *  Description of the Field
  @@ -71,7 +60,6 @@
       /**
        *  Description of the Field
        */
  -    protected final static boolean debugactivity = true;
       private int puts = 0;
       private int removes = 0;
   
  @@ -85,11 +73,8 @@
        */
       protected RemoteCacheServerListener( IRemoteCacheAttributes irca )
       {
  -
           this.irca = irca;
   
  -        log = LoggerManager.getLogger( "remote_remotecachemanager" );
  -
           // may need to add to ICacheManager interface to handle
           // the source arument extended update and remove methods
   
  @@ -133,9 +118,9 @@
           throws IOException
       {
           RemoteCacheServerInfo.listenerId = id;
  -        if ( debugcmd )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "set listenerId = " + id );
  +            log.debug( "set listenerId = " + id );
           }
       }
   
  @@ -154,9 +139,9 @@
           //getCacheManager();
   
           //p( "get listenerId" );
  -        if ( debugcmd )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "get listenerId = " + RemoteCacheServerInfo.listenerId );
  +            log.debug( "get listenerId = " + RemoteCacheServerInfo.listenerId );
           }
           return RemoteCacheServerInfo.listenerId;
       }
  @@ -172,9 +157,9 @@
       public int getRemoteType()
           throws IOException
       {
  -        if ( debugcmd )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "getRemoteType = " + irca.getRemoteType() );
  +            log.debug( "getRemoteType = " + irca.getRemoteType() );
           }
           return irca.getRemoteType();
       }
  @@ -219,12 +204,12 @@
       public void handlePut( ICacheElement cb )
           throws IOException
       {
  -        if ( debugactivity )
  +        if ( log.isDebugEnabled() )
           {
               puts++;
               if ( puts % 100 == 0 )
               {
  -                p( "puts = " + puts );
  +                log.debug( "puts = " + puts );
               }
           }
           ICompositeCache cache = ( ICompositeCache ) cacheMgr.getCache( irca.getCacheName() );
  @@ -243,23 +228,19 @@
       public void handleRemove( String cacheName, Serializable key )
           throws IOException
       {
  -        if ( debugactivity )
  +        if ( log.isDebugEnabled() )
           {
               removes++;
               if ( removes % 100 == 0 )
               {
  -                p( "removes = " + removes );
  +                log.debug( "removes = " + removes );
               }
           }
   
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "handleRemove> cacheName=" + cacheName + ", key=" + key );
           }
  -        if ( debugcmd )
  -        {
  -            p( "handleRemove> cacheName=" + cacheName + ", key=" + key );
  -        }
   
           getCacheManager();
           // interface limitation here
  @@ -279,7 +260,7 @@
       public void handleRemoveAll( String cacheName )
           throws IOException
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "handleRemoveAll> cacheName=" + cacheName );
           }
  @@ -299,7 +280,7 @@
       public void handleDispose( String cacheName )
           throws IOException
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "handleDispose> cacheName=" + cacheName );
           }
  @@ -318,32 +299,18 @@
           if ( cacheMgr == null )
           {
               cacheMgr = ( ICompositeCacheManager ) CacheManagerFactory.getInstance();
  -            p( "had to get cacheMgr" );
  -            if ( debugcmd )
  +
  +            if ( log.isDebugEnabled() )
               {
  -                p( "cacheMgr = " + cacheMgr );
  +                log.debug( "had to get cacheMgr: " + cacheMgr );
               }
           }
           else
           {
  -            if ( debugcmd )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "already got cacheMgr = " + cacheMgr );
  +                log.debug( "already got cacheMgr = " + cacheMgr );
               }
           }
       }
  -
  -
  -    //////////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    public static void p( String s )
  -    {
  -        System.out.println( "RemoteCacheServerListener: " + s );
  -    }
  -
   }
  -// end class
  
  
  
  1.7       +29 -44    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/group/RemoteGroupCacheServerFactory.java
  
  Index: RemoteGroupCacheServerFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/remote/server/group/RemoteGroupCacheServerFactory.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RemoteGroupCacheServerFactory.java	27 Jan 2002 18:34:02 -0000	1.6
  +++ RemoteGroupCacheServerFactory.java	15 Feb 2002 04:33:38 -0000	1.7
  @@ -18,8 +18,8 @@
   import org.apache.stratum.jcs.auxiliary.remote.behavior.IRemoteCacheServiceAdmin;
   import org.apache.stratum.jcs.auxiliary.remote.server.RemoteCacheServerAttributes;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Provides remote session cache services.
  @@ -30,16 +30,14 @@
   public class RemoteGroupCacheServerFactory
        implements IRemoteCacheConstants
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( RemoteGroupCacheServerFactory.class );
  +        
       /**
        *  The single instance of the RemoteGroupCacheServer object.
        */
       private static RemoteGroupCacheServer instance;
       private static String serviceName;
  -    static boolean debug = false;
  -
  -    private static Logger log = LoggerManager.getLogger( "group_remotegroupcacheserverfactory" );
  -
   
       /**
        *  Constructor for the RemoteGroupCacheServerFactory object
  @@ -78,7 +76,7 @@
               // TODO: make automatic
               RemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes();
   
  -            p( "Configuration file = " + propFile );
  +            log.debug( "Configuration file = " + propFile );
               rcsa.setConfigFileName( propFile );
   
               prop = RemoteUtils.loadProps( propFile );
  @@ -90,11 +88,11 @@
                   servicePort = Integer.parseInt( servicePortStr );
   
                   rcsa.setServicePort( servicePort );
  -                p( "Remote cache service uses port number " + servicePort + "." );
  +                log.debug( "Remote cache service uses port number " + servicePort + "." );
               }
               catch ( NumberFormatException ignore )
               {
  -                p( "Remote cache service port property " + REMOTE_CACHE_SERVICE_PORT + " not specified.  An anonymous port will be used." );
  +                log.debug( "Remote cache service port property " + REMOTE_CACHE_SERVICE_PORT + " not specified.  An anonymous port will be used." );
               }
   
               String lccStr = prop.getProperty( REMOTE_LOCAL_CLUSTER_CONSISTENCY );
  @@ -113,7 +111,7 @@
               }
               // Register the RemoteCacheServer remote object in the registry.
               serviceName = prop.getProperty( REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_VAL ).trim();
  -            p( "main> binding server to " + host + ":" + port + " with the name " +
  +            log.debug( "main> binding server to " + host + ":" + port + " with the name " +
                   serviceName );
               try
               {
  @@ -130,7 +128,7 @@
   
           // Start up tomcat inside remote cache, useful for monitoring
           boolean tomcatOn = Boolean.valueOf( prop.getProperty( TOMCAT_ON, "true" ).trim() ).booleanValue();
  -        p( "tomcatOn = " + tomcatOn );
  +        log.debug( "tomcatOn = " + tomcatOn );
           if ( tomcatOn )
           {
               String tomcatXml = prop.getProperty( TOMCAT_XML, "C:/dev/jakarta-turbine-stratum/props/remote.tomcat.xml" ).trim();
  @@ -160,7 +158,7 @@
               try
               {
                   Tomcat.main( arg );
  -                p( "started tomcat" );
  +                log.debug( "started tomcat" );
               }
               catch ( RuntimeException e )
               {
  @@ -191,7 +189,7 @@
               {
                   return;
               }
  -            p( "Unbinding host=" + host + ", port=" + port + ", serviceName=" + serviceName );
  +            log.debug( "Unbinding host=" + host + ", port=" + port + ", serviceName=" + serviceName );
               try
               {
                   Naming.unbind( "//" + host + ":" + port + "/" + serviceName );
  @@ -237,7 +235,7 @@
           if ( args.length > 0 && args[0].toLowerCase().indexOf( "-shutdown" ) != -1 )
           {
   
  -            p( "Sutting down cache" );
  +            log.debug( "Shutting down cache" );
   
               try
               {
  @@ -253,14 +251,14 @@
                   // shutdown.
                   String registry = "//:" + port + "/" + serviceName;
                   //if (debug) {
  -                p( "looking up server " + registry );
  +                log.debug( "looking up server " + registry );
                   //}
                   Object obj = Naming.lookup( registry );
                   //if (debug) {
  -                p( "server found" );
  +                log.debug( "server found" );
                   //}
   
  -                p( "obj = " + obj );
  +                log.debug( "obj = " + obj );
                   IRemoteCacheServiceAdmin admin = ( IRemoteCacheServiceAdmin ) obj;
   
                   try
  @@ -276,10 +274,9 @@
               }
               catch ( Exception ex )
               {
  -                p( ex.toString() );
  -                ex.printStackTrace( System.out );
  +                log.error( ex );
               }
  -            p( "done." );
  +            log.debug( "done" );
               System.exit( 0 );
           }
   
  @@ -287,7 +284,7 @@
           if ( args.length > 0 && args[0].toLowerCase().indexOf( "-stats" ) != -1 )
           {
   
  -            p( "getting cache stats" );
  +            log.debug( "getting cache stats" );
   
               try
               {
  @@ -301,29 +298,28 @@
   
                   String serviceName = prop.getProperty( REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_VAL ).trim();
                   String registry = "//:" + port + "/" + serviceName;
  -                p( "looking up server " + registry );
  +                log.debug( "looking up server " + registry );
                   Object obj = Naming.lookup( registry );
  -                p( "server found" );
  +                log.debug( "server found" );
   
  -                p( "obj = " + obj );
  +                log.debug( "obj = " + obj );
                   IRemoteCacheServiceAdmin admin = ( IRemoteCacheServiceAdmin ) obj;
   
                   try
                   {
  -                    p( admin.getStats() );
  +                    log.debug( admin.getStats() );
                   }
                   catch ( Exception es )
                   {
  -                    p( es.toString() );
  +                    log.error( es );
                   }
   
               }
               catch ( Exception ex )
               {
  -                p( ex.toString() );
  -                ex.printStackTrace( System.out );
  +                log.error( ex );
               }
  -            p( "done." );
  +            log.debug( "done." );
               System.exit( 0 );
           }
   
  @@ -340,24 +336,13 @@
           String host = prop.getProperty( "registry.host" );
           if ( host == null || host.trim().equals( "" ) || host.trim().equals( "localhost" ) )
           {
  -            p( "main> creating registry on the localhost" );
  +            log.debug( "main> creating registry on the localhost" );
               port = RemoteUtils.createRegistry( port );
           }
  -        p( "main> starting up RemoteGroupCacheServer" );
  +        log.debug( "main> starting up RemoteGroupCacheServer" );
           RemoteGroupCacheServerFactory.startup( host, port, args.length > 0 ? args[0] :
               null );
  -        p( "main> done" );
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p( String s )
  -    {
  -        System.out.println( "RemoteGroupCacheServer:" + s + " >" + Thread.currentThread().getName() );
  +        log.debug( "main> done" );
       }
   }
   
  
  
  
  1.4       +9 -18     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/config/OptionConverter.java
  
  Index: OptionConverter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/config/OptionConverter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- OptionConverter.java	15 Jan 2002 21:33:33 -0000	1.3
  +++ OptionConverter.java	15 Feb 2002 04:33:38 -0000	1.4
  @@ -2,10 +2,8 @@
   
   import java.util.Properties;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  -
  -//import org.apache.stratum.jcs.auxiliary.*;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  This class is based on the log4j class
  @@ -13,11 +11,6 @@
    *  G&uuml;lc&uuml; Simon Kitching; Avy Sharell (sharell@online.fr) Anders
    *  Kristensen Matthieu Verbert (mve@zurich.ibm.com)
    *
  - *@author     asmuts
  - *@created    January 15, 2002
  - */
  -
  -/**
    *  A convenience class to convert property values to specific types.
    *
    *@author     asmuts
  @@ -25,6 +18,8 @@
    */
   public class OptionConverter
   {
  +    private static final Log log = 
  +        LogSource.getInstance( OptionConverter.class );
   
       static String DELIM_START = "${";
       static char DELIM_STOP = '}';
  @@ -32,10 +27,7 @@
       static int DELIM_STOP_LEN = 1;
   
       static StringBuffer sbuf = new StringBuffer();
  -
  -    private static Logger log = LoggerManager.getLogger( OptionConverter.class );
  -
  -
  +    
       /**
        *  OptionConverter is a static class.
        */
  @@ -269,8 +261,8 @@
               }
               catch ( NumberFormatException e )
               {
  -                log.error( "[" + s + "] is not in proper int form." );
  -                log.error( e, "[" + value + "] not in expected format." );
  +                log.error( "[" + s + "] is not in proper int form" );
  +                log.error( "[" + value + "] not in expected format", e );
               }
           }
           return dEfault;
  @@ -300,7 +292,7 @@
           }
           catch ( IllegalArgumentException e )
           {
  -            log.error( e, "Bad option value [" + value + "]." );
  +            log.error( "Bad option value [" + value + "]", e );
               return value;
           }
       }
  @@ -337,12 +329,11 @@
               }
               catch ( Exception e )
               {
  -                log.error( e, "Could not instantiate class [" + className + "]." );
  +                log.error( "Could not instantiate class [" + className + "]", e );
               }
           }
           return defaultValue;
       }
  -
   
       /**
        *  Perform variable substitution in string <code>val</code> from the values
  
  
  
  1.4       +6 -8      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/config/PropertySetter.java
  
  Index: PropertySetter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/config/PropertySetter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PropertySetter.java	15 Jan 2002 21:33:33 -0000	1.3
  +++ PropertySetter.java	15 Feb 2002 04:33:38 -0000	1.4
  @@ -13,10 +13,8 @@
   import org.apache.stratum.jcs.config.OptionConverter;
   import org.apache.stratum.jcs.config.PropertySetterException;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  -
  -//import org.apache.stratum.jcs.auxiliary.*;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  This class is based on the log4j class
  @@ -47,6 +45,9 @@
    */
   public class PropertySetter
   {
  +    private static final Log log = 
  +        LogSource.getInstance( OptionConverter.class );
  +        
       /**
        *  Description of the Field
        */
  @@ -55,10 +56,7 @@
        *  Description of the Field
        */
       protected PropertyDescriptor[] props;
  -
  -    private static Logger log = LoggerManager.getLogger( PropertySetter.class );
  -
  -
  +    
       /**
        *  Create a new PropertySetter for the specified Object. This is done in
        *  prepartion for invoking {@link #setProperty} one or more times.
  
  
  
  1.6       +0 -14     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/Attributes.java
  
  Index: Attributes.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/Attributes.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Attributes.java	13 Feb 2002 19:13:59 -0000	1.5
  +++ Attributes.java	15 Feb 2002 04:33:38 -0000	1.6
  @@ -448,18 +448,4 @@
           //dump.append( " IS_GROUP_TTL_DESTROY = " + IS_GROUP_TTL_DESTROY + "\n");
           //dump.append( " IS_ORIGINAL = " + IS_ORIGINAL + "\n");
       }
  -
  -
  -    ///////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    public static void p( String s )
  -    {
  -        System.out.println( s );
  -    }
  -
   }
  -// end class Attributes
  
  
  
  1.4       +5 -23     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/CacheAdaptor.java
  
  Index: CacheAdaptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/CacheAdaptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CacheAdaptor.java	15 Jan 2002 21:33:33 -0000	1.3
  +++ CacheAdaptor.java	15 Feb 2002 04:33:38 -0000	1.4
  @@ -7,8 +7,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICacheElement;
   import org.apache.stratum.jcs.engine.behavior.ICacheListener;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Used for Cache-to-Cache messaging purposes.
  @@ -18,9 +18,9 @@
    */
   public class CacheAdaptor implements ICacheListener
   {
  +    private static final Log log = LogSource.getInstance( CacheAdaptor.class );
  +    
       private final ICache cache;
  -    private static boolean debug = false;
  -    private transient Logger log;
   
       /**
        *  Description of the Field
  @@ -39,7 +39,7 @@
           throws IOException
       {
           this.listenerId = id;
  -        p( "listenerId = " + id );
  +        log.debug( "listenerId = " + id );
       }
   
   
  @@ -65,11 +65,6 @@
       public CacheAdaptor( ICache cache )
       {
           this.cache = cache;
  -
  -        if ( debug )
  -        {
  -            this.log = LoggerManager.getLogger( this );
  -        }
       }
   
   
  @@ -137,17 +132,4 @@
       {
           cache.dispose();
       }
  -
  -
  -    ////////////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        log.debug( "CacehAdaptor:" + s );
  -    }
  -
   }
  
  
  
  1.5       +0 -11     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/CacheEventQueue.java
  
  Index: CacheEventQueue.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/CacheEventQueue.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CacheEventQueue.java	14 Feb 2002 20:42:44 -0000	1.4
  +++ CacheEventQueue.java	15 Feb 2002 04:33:38 -0000	1.5
  @@ -304,17 +304,6 @@
            */
           protected abstract void doRun()
               throws IOException;
  -
  -
  -        /**
  -         *  Description of the Method
  -         *
  -         *@param  s  Description of the Parameter
  -         */
  -        protected void p( String s )
  -        {
  -            System.out.println( "AbstractCacheEvent:" + s );
  -        }
       }
   
   
  
  
  
  1.4       +11 -10    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/CacheWatchRepairable.java
  
  Index: CacheWatchRepairable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/CacheWatchRepairable.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CacheWatchRepairable.java	15 Jan 2002 21:33:33 -0000	1.3
  +++ CacheWatchRepairable.java	15 Feb 2002 04:33:38 -0000	1.4
  @@ -13,25 +13,26 @@
   import org.apache.stratum.jcs.engine.behavior.ICacheListener;
   import org.apache.stratum.jcs.engine.behavior.ICacheObserver;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
  - *  Interceps the requests to the underlying ICacheObserver object so that the
  - *  listeners can be recorded locally for remote connection recovery purposes.
  - *  (Durable subscription like those in JMS is not implemented at this stage for
  - *  it can be too expensive on the runtime.)
  + * Interceps the requests to the underlying ICacheObserver object so that the
  + * listeners can be recorded locally for remote connection recovery purposes.
  + * (Durable subscription like those in JMS is not implemented at this stage for
  + * it can be too expensive on the runtime.)
    *
  - *@author     asmuts
  - *@created    January 15, 2002
  + * @author     asmuts
  + * @created    January 15, 2002
    */
   public class CacheWatchRepairable implements ICacheObserver
   {
  -    transient Logger log = LoggerManager.getInstance().getLogger( this );
  +    private final static Log log = 
  +        LogSource.getInstance( CacheWatchRepairable.class );
  +        
       // the underlying ICacheObserver.
       private ICacheObserver cacheWatch;
       private Map cacheMap = new HashMap();
  -
   
       /**
        *  Replaces the underlying cache watch service and reattached all existing
  
  
  
  1.4       +18 -84    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/CacheManagerFactory.java
  
  Index: CacheManagerFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/CacheManagerFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CacheManagerFactory.java	15 Jan 2002 21:33:35 -0000	1.3
  +++ CacheManagerFactory.java	15 Feb 2002 04:33:38 -0000	1.4
  @@ -1,118 +1,52 @@
   package org.apache.stratum.jcs.engine.control;
   
  -// UTILS
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
  -/////////////////////////////////////////////////////////////
   /**
  - *  Description of the Class
    *
  - *@author     asmuts
  - *@created    January 15, 2002
    */
  -public class CacheManagerFactory
  +public abstract class CacheManagerFactory
   {
  +    private final static Log log = 
  +        LogSource.getInstance( CacheManagerFactory.class );
  +    
       private static CompositeCacheManager instance;
   
       /**
  -     *  Description of the Field
  -     */
  -    protected static boolean debug = true;
  -    private static boolean debugR = false;
  -    /**
  -     *  Description of the Field
  -     */
  -    protected static boolean cmd = false;
  -
  -
  -    ///////////////////////////////////////////////////////////
  -    /**
  -     *  Constructor for the CacheManagerFactory object
  -     */
  -    private CacheManagerFactory() { }
  -
  -
  -    ///////////////////////////////////////////////////////////////////
  -    /**
  -     *  Gets the instance attribute of the CacheManagerFactory class
  -     *
  -     *@return    The instance value
  +     * Gets the instance of CompositeCacheManager
        */
       public static CompositeCacheManager getInstance()
       {
  -        //throws IOException, NotBoundException {
           return getInstance( null );
       }
   
  -    ///////////////////////////////////////////////////////////////////////////
  -
       /**
  -     *  Gets the instance attribute of the CacheManagerFactory class
  -     *
  -     *@param  propFile  Description of the Parameter
  -     *@return           The instance value
  +     * Gets the CompositeCacheManager instance
        */
       public static CompositeCacheManager getInstance( String propFile )
       {
  -        //throws IOException, NotBoundException
  -
           if ( instance == null )
           {
               synchronized ( CompositeCacheManager.class )
               {
                   if ( instance == null )
                   {
  -                    p1( "instance is null" );
  -                    instance = propFile == null ? new CompositeCacheManager() : new CompositeCacheManager( propFile );
  +                    log.debug( "Instance is null, creating" );
  +                    
  +                    if ( propFile == null )
  +                    {
  +                        instance = new CompositeCacheManager();
  +                    }
  +                    else
  +                    {
  +                        instance = new CompositeCacheManager( propFile );
  +                    }
                   }
               }
           }
  -        if ( debug )
  -        {
  -            instance.log.logIt( "Manager stats : " + instance.getStats() + "<br> -- in getInstance()" );
   
  -            if ( cmd )
  -            {
  -                System.out.println( "Manager stats : " + instance.getStats() + "<br> -- in getInstance()" );
  -            }
  -        }
           instance.incrementClients();
           return instance;
       }
  -
  -
  -    //////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        //System.out.println( "CacheManagerFactory: " + s + " >"+Thread.currentThread().getName() );
  -        instance.log.debug( "CacheManagerFactory: " + s + " >" + Thread.currentThread().getName() );
  -    }
  -
  -
  -    //////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p1( String s )
  -    {
  -        System.out.println( "CacheManagerFactory: " + s );
  -    }
  -
  -
  -    ///////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     */
  -    public void finalize()
  -    {
  -        p1( "THE ARE KILLING ME" );
  -    }
  -
   }
  -// end class
  
  
  
  1.4       +58 -135   jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/CompositeCacheConfigurator.java
  
  Index: CompositeCacheConfigurator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/CompositeCacheConfigurator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CompositeCacheConfigurator.java	15 Jan 2002 21:33:35 -0000	1.3
  +++ CompositeCacheConfigurator.java	15 Feb 2002 04:33:38 -0000	1.4
  @@ -20,10 +20,8 @@
   import org.apache.stratum.jcs.engine.behavior.ICache;
   import org.apache.stratum.jcs.engine.behavior.ICompositeCacheAttributes;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  -
  -//import org.apache.stratum.jcs.auxiliary.*;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  This class is based on the log4j class org.apache.log4j.PropertyConfigurator
  @@ -33,13 +31,10 @@
    *@author     asmuts
    *@created    January 15, 2002
    */
  -//////////////////////////////////////////////////
   public class CompositeCacheConfigurator
   {
  -
  -    // development level debug we want remove by the compiler for production
  -    final static boolean debug = false;
  -    //true;
  +    private static final Log log = 
  +        LogSource.getInstance( CompositeCacheConfigurator.class );
   
       final static String DEFAULT_REGION = "jcs.default";
       final static String REGION_PREFIX = "jcs.region.";
  @@ -48,13 +43,9 @@
       final static String ATTRIBUTE_PREFIX = ".attributes";
       final static String CACHE_ATTRIBUTE_PREFIX = ".cacheattributes";
       final static String ELEMENT_ATTRIBUTE_PREFIX = ".elementattributes";
  -
  -    private static Logger log = LoggerManager.getLogger( CompositeCacheConfigurator.class );
  -
  +    
       private CompositeCacheManager ccMgr;
   
  -
  -    //////////////////////////////////////////////////////////////
       /**
        *  Constructor for the CompositeCacheConfigurator object
        *
  @@ -65,8 +56,6 @@
           this.ccMgr = ccMgr;
       }
   
  -
  -    //////////////////////////////////////////////////////////////////////
       /**
        *  Configure cached for file name.
        *
  @@ -83,20 +72,17 @@
           }
           catch ( IOException e )
           {
  -            log.error( e, "Could not read configuration file [" + configFileName + "]." );
  -            log.error( "Ignoring configuration file [" + configFileName + "]." );
  +            log.error( "Could not read configuration file, ignored: " + 
  +                       configFileName, e );
               return;
           }
  +        
           // If we reach here, then the config file is alright.
           doConfigure( props );
       }
   
  -
  -    ////////////////////////////////////////////////////////////////////
       /**
  -     *  Configure cache for properties object
  -     *
  -     *@param  properties  Description of the Parameter
  +     * Configure cache for properties object
        */
       public void doConfigure( Properties properties )
       {
  @@ -116,51 +102,33 @@
           parseRegions( properties );
   
       }
  -    // end doConfigure
   
  -    /////////////////////////////////////////////////
       /**
  -     *  Set the default aux list for new caches.
  -     *
  -     *@param  props  The new defaultAuxValues value
  +     * Set the default aux list for new caches.
        */
       protected void setDefaultAuxValues( Properties props )
       {
           String value = OptionConverter.findAndSubst( DEFAULT_REGION, props );
           ccMgr.defaultAuxValues = value;
  -        if ( debug )
  -        {
  -            p( "setting defaults to " + value );
  -        }
  +
           log.info( "setting defaults to " + value );
       }
   
  -
  -    /////////////////////////////////////////////////
       /**
  -     *  Set the default CompositeCacheAttributes new caches.
  -     *
  -     *@param  props  The new defaultCompositeCacheAttributes value
  +     * Set the default CompositeCacheAttributes for new caches.
        */
       protected void setDefaultCompositeCacheAttributes( Properties props )
       {
  -
  -        ICompositeCacheAttributes icca = parseCompositeCacheAttributes( props, "", this.DEFAULT_REGION );
  +        ICompositeCacheAttributes icca = 
  +            parseCompositeCacheAttributes( props, "", this.DEFAULT_REGION );
           ccMgr.setDefaultCacheAttributes( icca );
  -        if ( debug )
  -        {
  -            p( "setting defaultCompositeCacheAttributes to " + icca );
  -        }
  +
           log.info( "setting defaultCompositeCacheAttributes to " + icca );
       }
   
  -
  -    ////////////////////////////////////////////////////////
       /**
  -     *  Create caches used internally. System status gives them creation
  -     *  priority.
  -     *
  -     *@param  props  Description of the Parameter
  +     * Create caches used internally. System status gives them creation
  +     * priority.
        */
       protected void parseSystemRegions( Properties props )
       {
  @@ -168,7 +136,8 @@
           while ( enum.hasMoreElements() )
           {
               String key = ( String ) enum.nextElement();
  -            if ( key.startsWith( SYSTEM_REGION_PREFIX ) && ( key.indexOf( "attributes" ) == -1 ) )
  +            if ( key.startsWith( SYSTEM_REGION_PREFIX ) 
  +                 && ( key.indexOf( "attributes" ) == -1 ) )
               {
                   String regionName = key.substring( SYSTEM_REGION_PREFIX.length() );
                   String value = OptionConverter.findAndSubst( key, props );
  @@ -184,12 +153,8 @@
           }
       }
   
  -
  -    ////////////////////////////////////////////////////////
       /**
  -     *  Parse region elements.
  -     *
  -     *@param  props  Description of the Parameter
  +     * Parse region elements.
        */
       protected void parseRegions( Properties props )
       {
  @@ -211,53 +176,41 @@
           }
       }
   
  -
  -    ///////////////////////////////////////////////////////////////////
       /**
  -     *  Create cache region.
  -     *
  -     *@param  props    Description of the Parameter
  -     *@param  regName  Description of the Parameter
  -     *@param  value    Description of the Parameter
  -     *@return          Description of the Return Value
  +     * Create cache region.
        */
  -    protected ICache parseRegion( Properties props, String regName, String value )
  +    protected ICache parseRegion( Properties props, 
  +                                  String regName, 
  +                                  String value )
       {
           return parseRegion( props, regName, value, null, REGION_PREFIX );
       }
   
  -
       /**
  -     *  Description of the Method
        *
  -     *@param  props    Description of the Parameter
  -     *@param  regName  Description of the Parameter
  -     *@param  value    Description of the Parameter
  -     *@param  cca      Description of the Parameter
  -     *@return          Description of the Return Value
        */
  -    protected ICache parseRegion( Properties props, String regName, String value, ICompositeCacheAttributes cca )
  +    protected ICache parseRegion( Properties props, 
  +                                  String regName, 
  +                                  String value, 
  +                                  ICompositeCacheAttributes cca )
       {
           return parseRegion( props, regName, value, cca, REGION_PREFIX );
       }
   
   
       /**
  -     *  Description of the Method
  -     *
  -     *@param  props         Description of the Parameter
  -     *@param  regName       Description of the Parameter
  -     *@param  value         Description of the Parameter
  -     *@param  cca           Description of the Parameter
  -     *@param  regionPrefix  Description of the Parameter
  -     *@return               Description of the Return Value
  +     * 
        */
  -    protected ICache parseRegion( Properties props, String regName, String value, ICompositeCacheAttributes cca, String regionPrefix )
  +    protected ICache parseRegion( Properties props, 
  +                                  String regName, 
  +                                  String value,
  +                                  ICompositeCacheAttributes cca, 
  +                                  String regionPrefix )
       {
  -
           List auxList = new ArrayList();
   
  -        log.debug( "Parsing for [" + regName + "] with value=[" + value + "]." );
  +        log.debug( "Parsing region name '" + regName + "', value '" + value + "'" );
  +        
           // We must skip over ',' but not white space
           StringTokenizer st = new StringTokenizer( value, "," );
   
  @@ -310,34 +263,25 @@
           }
           return cache;
       }
  -    // parseRegion
  -
  -
  +    
       /**
  -     *  Get an compositecacheattributes for the listed region.
  -     *
  -     *@param  props    Description of the Parameter
  -     *@param  regName  Description of the Parameter
  -     *@return          Description of the Return Value
  +     * Get an compositecacheattributes for the listed region.
        */
  -    protected ICompositeCacheAttributes parseCompositeCacheAttributes( Properties props, String regName )
  +    protected ICompositeCacheAttributes 
  +        parseCompositeCacheAttributes( Properties props, String regName )
       {
           return parseCompositeCacheAttributes( props, regName, REGION_PREFIX );
       }
   
   
       /**
  -     *  Description of the Method
        *
  -     *@param  props         Description of the Parameter
  -     *@param  regName       Description of the Parameter
  -     *@param  regionPrefix  Description of the Parameter
  -     *@return               Description of the Return Value
        */
  -    protected ICompositeCacheAttributes parseCompositeCacheAttributes( Properties props, String regName, String regionPrefix )
  +    protected ICompositeCacheAttributes 
  +        parseCompositeCacheAttributes( Properties props, 
  +                                       String regName, 
  +                                       String regionPrefix )
       {
  -
  -        // GET ATTRIBUTES
           ICompositeCacheAttributes ccAttr;
   
           String attrName = regionPrefix + regName + CACHE_ATTRIBUTE_PREFIX;
  @@ -349,35 +293,31 @@
               null );
           if ( ccAttr == null )
           {
  -            log.warn( "Could not instantiate ccAttr named \"" + attrName + "\".  Using defaults." );
  +            log.warn( "Could not instantiate ccAttr named '" + attrName + 
  +                      "', using defaults." );
  +            
               ICompositeCacheAttributes ccAttr2 = ccMgr.getDefaultCacheAttributes();
               ccAttr = ccAttr2.copy();
           }
   
  -        log.debug( "Parsing options for \"" + attrName + "\"." );
  +        log.debug( "Parsing options for '" + attrName + "'" );
  +        
           PropertySetter.setProperties( ccAttr, props, attrName + "." );
           ccAttr.setCacheName( regName );
  -        if ( debug )
  -        {
  -            p( "ccAttr = " + ccAttr.toString() );
  -        }
  +        
           log.debug( "End of parsing for \"" + attrName + "\"." );
   
           // GET CACHE FROM FACTORY WITH ATTRIBUTES
           ccAttr.setCacheName( regName );
           return ccAttr;
       }
  -    // end parCacheAttribute
   
       /**
  -     *  Get an aux cache for the listed aux for a region.
  -     *
  -     *@param  props    Description of the Parameter
  -     *@param  auxName  Description of the Parameter
  -     *@param  regName  Description of the Parameter
  -     *@return          Description of the Return Value
  +     * Get an aux cache for the listed aux for a region.
        */
  -    protected ICache parseAuxiliary( Properties props, String auxName, String regName )
  +    protected ICache parseAuxiliary( Properties props, 
  +                                     String auxName, 
  +                                     String regName )
       {
           ICache auxCache;
   
  @@ -411,7 +351,7 @@
                   null );
               if ( auxFac == null )
               {
  -                log.error( "Could not instantiate auxAttr named \"" + attrName + "\"." );
  +                log.error( "Could not instantiate auxAttr named '" + attrName + "'" );
                   return null;
               }
               auxAttr.setName( auxName );
  @@ -420,32 +360,15 @@
   
           auxAttr = auxAttr.copy();
   
  -        log.debug( "Parsing options for \"" + attrName + "\"." );
  +        log.debug( "Parsing options for '" + attrName + "'" );
           PropertySetter.setProperties( auxAttr, props, attrName + "." );
           auxAttr.setCacheName( regName );
  -        if ( debug )
  -        {
  -            p( "auxAttr = " + auxAttr.toString() );
  -        }
  -        log.debug( "End of parsing for \"" + attrName + "\"." );
  +
  +        log.debug( "End of parsing for '" + attrName + "'" );
   
           // GET CACHE FROM FACTORY WITH ATTRIBUTES
           auxAttr.setCacheName( regName );
           auxCache = auxFac.createCache( auxAttr );
           return auxCache;
       }
  -    // end parseregion
  -
  -    ///////////////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        System.out.println( "CompositeCacheConfigurator: " + s );
  -    }
  -
   }
  -// end
  
  
  
  1.4       +108 -269  jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/CompositeCacheManager.java
  
  Index: CompositeCacheManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/CompositeCacheManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CompositeCacheManager.java	15 Jan 2002 21:33:35 -0000	1.3
  +++ CompositeCacheManager.java	15 Feb 2002 04:33:39 -0000	1.4
  @@ -1,6 +1,5 @@
   package org.apache.stratum.jcs.engine.control;
   
  -//////////////////////////////////
   import java.io.InputStream;
   import java.io.IOException;
   import java.io.Serializable;
  @@ -27,127 +26,78 @@
   import org.apache.stratum.jcs.engine.behavior.ICompositeCacheAttributes;
   import org.apache.stratum.jcs.engine.behavior.ICompositeCacheManager;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
  -/////////////////////////////////////
  -//import org.apache.stratum.jcs.auxiliary.*;
  -
  -///////////////////////////////////////////////////////////////////////
   /**
  - *  Description of the Class
  - *
  - *@author     asmuts
  - *@created    January 15, 2002
  + * Manages a composite cache.
    */
  -public class CompositeCacheManager implements ICompositeCacheManager, IRemoteCacheConstants, Serializable
  +public class CompositeCacheManager 
  +    implements ICompositeCacheManager, IRemoteCacheConstants, Serializable
   {
  -//IRemoteCacheListener, IRemoteCacheConstants, Serializable {
  +    private static final Log log = 
  +        LogSource.getInstance( CompositeCacheManager.class );
   
  -    /**
  -     *  Description of the Field
  -     */
  +    /** Caches managed by this cache manager */
       protected Hashtable caches = new Hashtable();
  -    /**
  -     *  Description of the Field
  -     */
  +
  +    /** Internal system caches for this cache manager */
       protected Hashtable systemCaches = new Hashtable();
   
  -    /**
  -     *  Description of the Field
  -     */
  -    public final Logger log;
  +    /** Number of clients accessing this cache manager */
       private int clients;
   
  -    /**
  -     *  Description of the Field
  -     */
  -    protected ICompositeCacheAttributes defaultCacheAttr = new CompositeCacheAttributes();
  -    /**
  -     *  Description of the Field
  -     */
  +    /** Default cache attributes for this cache manager */
  +    protected ICompositeCacheAttributes defaultCacheAttr = 
  +        new CompositeCacheAttributes();
  +    
  +    /** Default elemeent attributes for this cache manager */
       protected Attributes defaultElementAttr = new Attributes();
   
  -    // Defaults the cache service name to the rmi server's class name.
  +    /** Defaults the cache service name to the rmi server's class name */
       private String remoteServiceName;
   
  -    /**
  -     *  Used internally to keep track of configured auxiliaries.
  -     */
  +    /** Used to keep track of configured auxiliaries */
       protected Hashtable auxFacs = new Hashtable( 11 );
  -    /**
  -     *  Description of the Field
  -     */
  +    
  +    /** ??? */
       protected Hashtable auxAttrs = new Hashtable( 11 );
   
  -    /**
  -     *  Description of the Field
  -     */
  +    /** Properties with which this manager was configured */
       protected Properties props;
   
  -    // the deafult auxiliary caches to be used by the non preconfigured
  -    /**
  -     *  Description of the Field
  -     */
  +    /** The default auxiliary caches to be used if not preconfigured */
       protected String defaultAuxValues;
  -
  -    /**
  -     *  Description of the Field
  -     */
  -    protected static boolean debug = false;
  -    /**
  -     *  Description of the Field
  -     */
  -    protected static boolean debugCnst = false;
  -    private static boolean debugR = false;
  -    /**
  -     *  Description of the Field
  -     */
  -    protected static boolean cmd = false;
  -    private final static boolean pOut = false;
  -    //true;
  -
  -    ////////////////////////////////////////////////
  + 
       /**
        *  Constructor for the CompositeCacheManager object
        */
       protected CompositeCacheManager()
       {
           this( "/cache.ccf" );
  -        if ( debugCnst )
  -        {
  -            p( "creating cache manager with default propsfile" );
  -        }
       }
   
  -
  -    /////////////////////////////////////////////////
       /**
  -     *  Constructor for the CompositeCacheManager object
  -     *
  -     *@param  propFile  Description of the Parameter
  +     * Constructor for the CompositeCacheManager object
        */
       protected CompositeCacheManager( String propFile )
       {
  -        if ( cmd )
  -        {
  -            p( "creating cache manager with propFile = " + propFile );
  -        }
  -        log = LoggerManager.getLogger( this );
  +        log.debug( "Creating cache manager from config file: " + propFile );
   
           Properties props = new Properties();
           InputStream is = getClass().getResourceAsStream( propFile );
           try
           {
               props.load( is );
  -            if ( debug )
  +            
  +            if ( log.isDebugEnabled() )
               {
  -                log.debug( "props.size=" + props.size() + ", " + props );
  +                log.debug( "File contained " + props.size() + " properties" );
               }
           }
           catch ( IOException ex )
           {
  -            log.error( ex );
  +            log.error( "Failed to load properties", ex );
               throw new IllegalStateException( ex.getMessage() );
           }
           finally
  @@ -157,33 +107,33 @@
                   is.close();
               }
               catch ( IOException ignore )
  -            {}
  +            {
  +                // Ignored
  +            }
           }
   
  -        // need to do something for defaults
  +        // FIXME: need to do something for defaults
           // create a default entry in the propsfile
  -        //setDefaults( props );
  +        // setDefaults( props );
   
  -        // Create caches.
  +        // Create caches
  +        
           try
           {
               createCaches( props );
           }
           catch ( IOException ex )
           {
  -            log.error( ex );
  +            log.error( "Failed to create caches", ex );
               throw new IllegalStateException( ex.getMessage() );
           }
           catch ( NotBoundException ex )
           {
  -            log.error( ex );
  +            log.error( "Failed to create caches", ex );
               throw new IllegalStateException( ex.getMessage() );
           }
  -
       }
   
  -
  -    /////////////////////////////////////////////
       /**
        *  Gets the defaultCacheAttributes attribute of the CompositeCacheManager
        *  object
  @@ -207,14 +157,8 @@
           this.defaultCacheAttr = icca;
       }
   
  -
  -    /////////////////////////////////////////////////////////////
       /**
  -     *  Description of the Method
  -     *
  -     *@param  props                  Description of the Parameter
  -     *@exception  IOException        Description of the Exception
  -     *@exception  NotBoundException  Description of the Exception
  +     * 
        */
       private void createCaches( Properties props )
           throws IOException, NotBoundException
  @@ -222,58 +166,37 @@
           CompositeCacheConfigurator ccc = new CompositeCacheConfigurator( this );
           ccc.doConfigure( props );
       }
  -    // end createCaches
   
       /**
  -     *  method for internal system cache creation
  -     *
  -     *@param  cacheName  Description of the Parameter
  -     *@param  auxCaches  Description of the Parameter
  -     *@param  cattr      Description of the Parameter
  -     *@param  attr       Description of the Parameter
  -     *@return            Description of the Return Value
  +     * Creates internal system cache
        */
  -    protected Cache createSystemCache( String cacheName, ICache[] auxCaches, ICompositeCacheAttributes cattr, Attributes attr )
  -    {
  -        if ( cmd )
  -        {
  -            p( "called create cache in cachemanager" );
  -        }
  +    protected Cache createSystemCache( String cacheName, 
  +                                       ICache[] auxCaches, 
  +                                       ICompositeCacheAttributes cattr, 
  +                                       Attributes attr )
  +    {        
           return new Cache( cacheName, auxCaches, cattr, attr );
       }
   
   
       /**
  -     *  Factory method to create the actual Cache instance. Subclass can
  -     *  override this method to create the specific cache.
  -     *
  -     *@param  cacheName  Description of the Parameter
  -     *@param  auxCaches  Description of the Parameter
  -     *@param  cattr      Description of the Parameter
  -     *@param  attr       Description of the Parameter
  -     *@return            Description of the Return Value
  +     * Factory method to create the actual Cache instance. Subclass can
  +     * override this method to create the specific cache.
        */
  -    protected Cache createCache( String cacheName, ICache[] auxCaches, ICompositeCacheAttributes cattr, Attributes attr )
  +    protected Cache createCache( String cacheName, 
  +                                 ICache[] auxCaches, 
  +                                 ICompositeCacheAttributes cattr, 
  +                                 Attributes attr )
       {
  -        if ( cmd )
  -        {
  -            p( "called create cache in cachemanager" );
  -        }
           return new Cache( cacheName, auxCaches, cattr, attr );
       }
   
  -
  -    /////////////////////////////////////////////////////////////
       /**
        *  Gets the auxCaches attribute of the CompositeCacheManager object
  -     *
  -     *@param  cacheName  Description of the Parameter
  -     *@param  iaca       Description of the Parameter
  -     *@return            The auxCaches value
        */
  -    private ICache[] getAuxCaches( String cacheName, IAuxiliaryCacheAttributes iaca )
  +    private ICache[] getAuxCaches( String cacheName, 
  +                                   IAuxiliaryCacheAttributes iaca )
       {
  -
           List auxList = new ArrayList();
   
           Enumeration enum = auxFacs.elements();
  @@ -287,28 +210,17 @@
   
           return ( ICache[] ) auxList.toArray( new ICache[0] );
       }
  -    // end getAucCaches
   
  -    /////////////////////////////////////////////////////////
       /**
  -     *  Gets the cache attribute of the CompositeCacheManager object
  -     *
  -     *@param  cacheName  Description of the Parameter
  -     *@return            The cache value
  +     * Gets the cache attribute of the CompositeCacheManager object
        */
       public ICache getCache( String cacheName )
       {
           return getCache( cacheName, this.defaultCacheAttr.copy() );
       }
  -
  -    /////////////////////////////////////////////////////////
  -
  +    
       /**
  -     *  Gets the cache attribute of the CompositeCacheManager object
  -     *
  -     *@param  cacheName  Description of the Parameter
  -     *@param  cattr      Description of the Parameter
  -     *@return            The cache value
  +     * Gets the cache attribute of the CompositeCacheManager object
        */
       public ICache getCache( String cacheName, ICompositeCacheAttributes cattr )
       {
  @@ -316,56 +228,37 @@
           return getCache( cattr, this.defaultElementAttr );
       }
   
  -
       /**
  -     *  Gets the cache attribute of the CompositeCacheManager object
  -     *
  -     *@param  cacheName  Description of the Parameter
  -     *@param  cattr      Description of the Parameter
  -     *@param  attr       Description of the Parameter
  -     *@return            The cache value
  +     * Gets the cache attribute of the CompositeCacheManager object
        */
  -    public ICache getCache( String cacheName, ICompositeCacheAttributes cattr, Attributes attr )
  +    public ICache getCache( String cacheName, 
  +                            ICompositeCacheAttributes cattr, 
  +                            Attributes attr )
       {
           cattr.setCacheName( cacheName );
           return getCache( cattr, this.defaultElementAttr );
       }
   
  -
       /**
  -     *  Gets the cache attribute of the CompositeCacheManager object
  -     *
  -     *@param  cattr  Description of the Parameter
  -     *@return        The cache value
  +     * Gets the cache attribute of the CompositeCacheManager object
        */
       public ICache getCache( ICompositeCacheAttributes cattr )
       {
           return getCache( cattr, this.defaultElementAttr );
       }
   
  -    /////////////////////////////////////////////////////////
  -
       /**
  -     *  If the cache is created the CacheAttributes and the element Attributes
  -     *  will be ignored. Currently there is no overiding once it is set up.
  -     *  Overriding hte default elemental atributes will require cahnging the way
  -     *  the atributes are assigned to elements. Get cache creates a cache with
  -     *  defaults if none are specified. We might want to create separate method
  -     *  for creating/getting. . .
  -     *
  -     *@param  cattr  Description of the Parameter
  -     *@param  attr   Description of the Parameter
  -     *@return        The cache value
  +     * If the cache is created the CacheAttributes and the element Attributes
  +     * will be ignored. Currently there is no overiding once it is set up.
  +     * Overriding hte default elemental atributes will require cahnging the way
  +     * the atributes are assigned to elements. Get cache creates a cache with
  +     * defaults if none are specified. We might want to create separate method
  +     * for creating/getting. . .
        */
       public ICache getCache( ICompositeCacheAttributes cattr, Attributes attr )
       {
  -
  -        if ( debug )
  -        {
  -            p( "cattr = " + cattr );
  -        }
  -
           ICache cache = ( ICache ) caches.get( cattr.getCacheName() );
  +        
           if ( cache == null )
           {
               synchronized ( caches )
  @@ -383,69 +276,61 @@
                   }
               }
           }
  -        if ( debug )
  +        
  +        if ( log.isDebugEnabled() )
           {
  -            p( "Manager stats : " + getStats() );
  +            log.debug( "At end of getCache, manager stats: " + getStats() );
           }
  +        
           return cache;
       }
   
  -
  -    ////////////////////////////////////////////////////////////////
       /**
  -     *  Description of the Method
  -     *
  -     *@param  name  Description of the Parameter
  +     * 
        */
       public void freeCache( String name )
       {
           freeCache( name, Cache.LOCAL_INVOKATION );
       }
   
  -
  -    //////////////////////////////////////////////////////////////
       /**
  -     *  Description of the Method
        *
  -     *@param  name        Description of the Parameter
  -     *@param  fromRemote  Description of the Parameter
        */
       public void freeCache( String name, boolean fromRemote )
       {
           Cache cache = ( Cache ) caches.get( name );
  +        
           if ( cache != null )
           {
               cache.dispose( fromRemote );
           }
       }
  -    // end freeCache
   
  -    //////////////////////////////////////////////////////////
       /**
  -     *  Gets the stats attribute of the CompositeCacheManager object
  -     *
  -     *@return    The stats value
  +     * 
        */
       public String getStats()
       {
           StringBuffer stats = new StringBuffer();
  +        
           Enumeration allCaches = caches.elements();
  +        
           while ( allCaches.hasMoreElements() )
           {
               ICache cache = ( ICache ) allCaches.nextElement();
  +            
               if ( cache != null )
               {
  -                stats.append( "<br>&nbsp;&nbsp;&nbsp;" + cache.getStats() + " clients = "
  -                     + clients );
  +                stats.append( "Cache stats: " ).append( cache.getStats() )
  +                     .append( " clients = " ).append( clients );
               }
           }
  +        
           return stats.toString();
       }
  -    // end getStats
  -
  -    //////////////////////////////////////////////
  +    
       /**
  -     *  Description of the Method
  +     * 
        */
       protected void incrementClients()
       {
  @@ -454,19 +339,15 @@
   
   
       /**
  -     *  Disposes of all caches.
  +     *
        */
       public void release()
       {
           release( Cache.LOCAL_INVOKATION );
       }
   
  -    /////////////////////////////////////////////////
  -
       /**
  -     *  Description of the Method
  -     *
  -     *@param  fromRemote  Description of the Parameter
  +     * 
        */
       private void release( boolean fromRemote )
       {
  @@ -475,36 +356,38 @@
               // Wait until called by the last client
               if ( --clients > 0 )
               {
  -                p( "release was called; clients = " + clients );
  -                log.warn( "clients = " + clients );
  -                return;
  +                if ( log.isDebugEnabled() )
  +                {
  +                    log.debug( "Release called, but " + clients + " remain" );
  +                    return;
  +                }
  +            }
  +            
  +            // FIXME: Is this really warn or should it be debug?
  +            
  +            if ( log.isWarnEnabled() )
  +            {
  +                log.warn( "Last client called release. There are " 
  +                          + caches.size() + " caches which will be disposed" );
  +                log.warn( "Manager stats: " + getStats() );
               }
  -            log.warn( "clients = " + clients );
  -            log.warn( "There are " + caches.size() + " caches open" );
  -            log.warn( "DISPOSING OF ALL CACHES" );
  -            log.warn( getStats() );
  -            p( "DISPOSING OF ALL CACHES" );
  -            p( getStats() );
   
               Enumeration allCaches = caches.elements();
  +            
               while ( allCaches.hasMoreElements() )
               {
                   Cache cache = ( Cache ) allCaches.nextElement();
  +                
                   if ( cache != null )
                   {
                       cache.dispose( fromRemote );
                   }
               }
           }
  -        log.flush();
       }
  -    //end release()
   
  -    //////////////////////////////////////////////////////////
       /**
  -     *  Returns a list of the current cache names.
  -     *
  -     *@return    The cacheNames value
  +     * Returns a list of the current cache names.
        */
       public String[] getCacheNames()
       {
  @@ -517,36 +400,24 @@
           return list;
       }
   
  -
  -    ///////////////////////////////////////
       /**
  -     *  Gets the cacheType attribute of the CompositeCacheManager object
  -     *
  -     *@return    The cacheType value
  +     * 
        */
       public int getCacheType()
       {
           return COMPOSITE_CACHE;
       }
   
  -
  -    ////////////////////////////////////////
       /**
  -     *  Gets the defaultCattr attribute of the CompositeCacheManager object
  -     *
  -     *@return    The defaultCattr value
  +     * 
        */
       public ICompositeCacheAttributes getDefaultCattr()
       {
           return this.defaultCacheAttr;
       }
   
  -
  -    //////////////////////////////////////////
       /**
  -     *  Description of the Method
  -     *
  -     *@param  auxFac  Description of the Parameter
  +     * 
        */
       void registryFacPut( IAuxiliaryCacheFactory auxFac )
       {
  @@ -555,60 +426,28 @@
   
   
       /**
  -     *  Description of the Method
  -     *
  -     *@param  name  Description of the Parameter
  -     *@return       Description of the Return Value
  +     * 
        */
       IAuxiliaryCacheFactory registryFacGet( String name )
       {
           return ( IAuxiliaryCacheFactory ) auxFacs.get( name );
       }
   
  -
  -    //////////////////////////////////////////
       /**
  -     *  Description of the Method
  -     *
  -     *@param  auxAttr  Description of the Parameter
  +     * 
        */
       void registryAttrPut( IAuxiliaryCacheAttributes auxAttr )
       {
           auxAttrs.put( auxAttr.getName(), auxAttr );
       }
   
  -
       /**
  -     *  Description of the Method
  -     *
  -     *@param  name  Description of the Parameter
  -     *@return       Description of the Return Value
  +     * 
        */
       IAuxiliaryCacheAttributes registryAttrGet( String name )
       {
           return ( IAuxiliaryCacheAttributes ) auxAttrs.get( name );
       }
  -
  -
  -    /////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    public void p( String s )
  -    {
  -        if ( log.logLevel >= log.DEBUG )
  -        {
  -            log.debug( s );
  -        }
  -        if ( pOut )
  -        {
  -            System.out.println( "CompositeCacheManager: " + s );
  -        }
  -    }
  -
   }
  -// end class
   
   
  
  
  
  1.4       +29 -42    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/group/GroupCacheManager.java
  
  Index: GroupCacheManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/group/GroupCacheManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- GroupCacheManager.java	15 Jan 2002 21:33:35 -0000	1.3
  +++ GroupCacheManager.java	15 Feb 2002 04:33:39 -0000	1.4
  @@ -11,85 +11,72 @@
   import org.apache.stratum.jcs.engine.control.Cache;
   import org.apache.stratum.jcs.engine.control.CompositeCacheManager;
   
  -/////////////////////////////////////
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
  -//////////////////////////////////////////////////////////////////
   /**
  - *  Description of the Class
    *
  - *@author     asmuts
  - *@created    January 15, 2002
    */
  -public class GroupCacheManager extends CompositeCacheManager implements Serializable
  +public class GroupCacheManager 
  +    extends CompositeCacheManager 
  +    implements Serializable
   {
  +    private static final Log log = 
  +        LogSource.getInstance( CompositeCacheManager.class );
   
       private static GroupCacheManager instance;
   
  -
  -    ///////////////////////////////////////////
       /**
  -     *  Constructor for the GroupCacheManager object
  +     * Constructor for the GroupCacheManager object
        */
       protected GroupCacheManager()
       {
           super();
       }
   
  -
  -    ///////////////////////////////////////////////
       /**
  -     *  Constructor for the GroupCacheManager object
  -     *
  -     *@param  propFile  Description of the Parameter
  +     * Constructor for the GroupCacheManager object
        */
       protected GroupCacheManager( String propFile )
       {
           super( propFile );
       }
   
  -
       /**
  -     *  Factory method to create the actual GroupCache instance.
  -     *
  -     *@param  cacheName  Description of the Parameter
  -     *@param  auxCaches  Description of the Parameter
  -     *@param  cattr      Description of the Parameter
  -     *@param  attr       Description of the Parameter
  -     *@return            Description of the Return Value
  +     * Factory method to create the actual GroupCache instance.
        */
  -    protected Cache createSystemCache( String cacheName, ICache[] auxCaches, ICompositeCacheAttributes cattr, Attributes attr )
  +    protected Cache createSystemCache( String cacheName, 
  +                                       ICache[] auxCaches, 
  +                                       ICompositeCacheAttributes cattr, 
  +                                       Attributes attr )
       {
  -        p( "called create cache in groupcachemanager" );
  -        ICompositeCache systemGroupIdCache = ( ICompositeCache ) systemCaches.get( "groupIdCache" );
  -        return new GroupCache( cacheName, auxCaches, cattr, attr, systemGroupIdCache );
  +        ICompositeCache systemGroupIdCache = 
  +            ( ICompositeCache ) systemCaches.get( "groupIdCache" );
  +        
  +        return new GroupCache( cacheName, auxCaches, cattr, attr, 
  +                               systemGroupIdCache );
       }
   
  -
       /**
  -     *  Description of the Method
        *
  -     *@param  cacheName  Description of the Parameter
  -     *@param  auxCaches  Description of the Parameter
  -     *@param  cattr      Description of the Parameter
  -     *@param  attr       Description of the Parameter
  -     *@return            Description of the Return Value
        */
  -    protected Cache createCache( String cacheName, ICache[] auxCaches, ICompositeCacheAttributes cattr, Attributes attr )
  +    protected Cache createCache( String cacheName, 
  +                                 ICache[] auxCaches, 
  +                                 ICompositeCacheAttributes cattr,
  +                                 Attributes attr )
       {
  -        p( "called create cache in groupcachemanager" );
  -        // sort of add hoc
  -        ICompositeCache systemGroupIdCache = ( ICompositeCache ) systemCaches.get( "groupIdCache" );
  -        return new GroupCache( cacheName, auxCaches, cattr, attr, systemGroupIdCache );
  +        ICompositeCache systemGroupIdCache = 
  +            ( ICompositeCache ) systemCaches.get( "groupIdCache" );
  +        
  +        return new GroupCache( cacheName, auxCaches, cattr, attr, 
  +                               systemGroupIdCache );
       }
   
  -
       /**
  -     *  Description of the Method
  +     *
        */
       protected void incrementClients()
       {
           super.incrementClients();
       }
  -
   }
  -// end class
  
  
  
  1.4       +23 -53    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/group/GroupCacheManagerFactory.java
  
  Index: GroupCacheManagerFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/group/GroupCacheManagerFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- GroupCacheManagerFactory.java	15 Jan 2002 21:33:35 -0000	1.3
  +++ GroupCacheManagerFactory.java	15 Feb 2002 04:33:39 -0000	1.4
  @@ -2,83 +2,53 @@
   
   import org.apache.stratum.jcs.engine.group.GroupCacheManager;
   
  -/////////////////////////////////////////////////////////////
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
  +
   /**
  - *  Description of the Class
  - *
  - *@author     asmuts
  - *@created    January 15, 2002
  + * 
    */
  -public class GroupCacheManagerFactory
  -{
  -
  -    private final static boolean pOut = false;
  -    //true;
  -
  +public abstract class GroupCacheManagerFactory
  +{    
  +    private final static Log log = 
  +        LogSource.getInstance( GroupCacheManagerFactory.class );
  +    
       private static GroupCacheManager instance;
   
  -
  -    //////////////////////////////////////////
       /**
  -     *  Constructor for the GroupCacheManagerFactory object
  -     */
  -    private GroupCacheManagerFactory() { }
  -
  -
  -    ///////////////////////////////////////////
  -    /**
  -     *  Gets the instance attribute of the GroupCacheManagerFactory class
  -     *
  -     *@return    The instance value
  +     * 
        */
       public static GroupCacheManager getInstance()
       {
           return getInstance( null );
       }
   
  -
  -    //////////////////////////////////////////////
       /**
  -     *  Gets the instance attribute of the GroupCacheManagerFactory class
  -     *
  -     *@param  propFile  Description of the Parameter
  -     *@return           The instance value
  +     * 
        */
       public static GroupCacheManager getInstance( String propFile )
       {
  -        p( "getting GroupCacheManger instance" );
           if ( instance == null )
           {
               synchronized ( GroupCacheManager.class )
               {
                   if ( instance == null )
                   {
  -                    instance = propFile == null ? new GroupCacheManager() : new GroupCacheManager( propFile );
  +                    log.debug( "Instance is null, creating" );
  +                    
  +                    if ( propFile == null )
  +                    {
  +                        instance = new GroupCacheManager();
  +                    }
  +                    else
  +                    {
  +                        instance = new GroupCacheManager( propFile );
  +                    }
                   }
               }
           }
  -        if ( instance.log.logLevel >= instance.log.DEBUG )
  -        {
  -            instance.log.debug( "Manager stats : " + instance.getStats() + "<br> -- in getInstance()" );
  -        }
  +
           instance.incrementClients();
           return instance;
       }
  -
  -
  -    //////////////////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p( String s )
  -    {
  -        if ( pOut )
  -        {
  -            System.out.println( "GroupCacheManagerFactory:" + s + " >" + Thread.currentThread().getName() );
  -        }
  -    }
  -
  -}
  -// end class
  +}
  \ No newline at end of file
  
  
  
  1.4       +8 -16     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/group/GroupRWLockManager.java
  
  Index: GroupRWLockManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/group/GroupRWLockManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- GroupRWLockManager.java	15 Jan 2002 21:33:35 -0000	1.3
  +++ GroupRWLockManager.java	15 Feb 2002 04:33:39 -0000	1.4
  @@ -4,6 +4,9 @@
   
   import org.apache.stratum.jcs.utils.reuse.ReadWriteLockManager;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
  +
   /**
    *  The ReadWriteLock Manager for distributed group list management.
    *
  @@ -12,15 +15,15 @@
    */
   class GroupRWLockManager extends ReadWriteLockManager
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( GroupRWLockManager.class );
  +    
       /**
        *  Description of the Field
        */
  -    public final static boolean debug = false;
       private static GroupRWLockManager instance;
       private final Hashtable ht = new Hashtable();
   
  -
       /**
        *  Returns the lock table of all the resources managed by this manager.
        *
  @@ -52,24 +55,13 @@
                   if ( instance == null )
                   {
                       instance = new GroupRWLockManager();
  -                    if ( debug )
  +                    if ( log.isDebugEnabled() )
                       {
  -                        p( "   >> GroupRWLockManager instanciated." );
  +                        log.debug( "   >> GroupRWLockManager instanciated." );
                       }
                   }
               }
           }
           return instance;
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private static void p( String s )
  -    {
  -        System.out.println( "GroupRWLockManager:" + s );
       }
   }
  
  
  
  1.7       +10 -42    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/memory/lru/LRUMemoryCache.java
  
  Index: LRUMemoryCache.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/memory/lru/LRUMemoryCache.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LRUMemoryCache.java	14 Feb 2002 05:30:51 -0000	1.6
  +++ LRUMemoryCache.java	15 Feb 2002 04:33:39 -0000	1.7
  @@ -23,10 +23,8 @@
   import org.apache.stratum.jcs.engine.memory.MemoryElementDescriptor;
   import org.apache.stratum.jcs.engine.memory.behavior.IMemoryCache;
   
  -import org.apache.log4j.Category;
  -
  -//import org.apache.stratum.jcs.utils.log.Logger;
  -//import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /////////////////////////////////////////////////////
   /**
  @@ -45,11 +43,8 @@
    */
   public class LRUMemoryCache implements IMemoryCache, ICache, Serializable
   {
  -
  -    private final static boolean debugcmd = false;
  -    // removal
  -    private final static boolean debugR = false;
  -    //true;
  +    private static final Log log = 
  +        LogSource.getInstance( LRUMemoryCache.class );
   
       // MOVE TO MEMORYMANAGER
       String cacheName;
  @@ -77,12 +72,6 @@
   
       private String source_id = "org.apache.stratum.jcs.engine.memory.lru.LRUMemoryCache";
   
  -    // need to convert to log4j
  -    /**
  -     *  Description of the Field
  -     */
  -    protected final static Category log = Category.getInstance( LRUMemoryCache.class );
  -
       // The HUB
       ICacheHub hub;
   
  @@ -192,10 +181,7 @@
           {
   
               // SPOOL LAST -- need to make this a grouping in a queue
  -            if ( debugcmd )
  -            {
  -                p( "IN RAM overflow" );
  -            }
  +            log.debug( "IN RAM overflow" );
   
               // write the last item to disk.
               try
  @@ -204,9 +190,9 @@
                   // PUSH 5 TO DISK TO MINIMIZE THE TYPICAL
                   int chunkSizeCorrected = Math.min( size, chunkSize );
   
  -                if ( debugcmd )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "update: About to spool to disk cache, map.size() = " + size + ", this.cattr.getMaxObjects() = " + this.cattr.getMaxObjects() + ", chunkSizeCorrected = " + chunkSizeCorrected );
  +                    log.debug( "update: About to spool to disk cache, map.size() = " + size + ", this.cattr.getMaxObjects() = " + this.cattr.getMaxObjects() + ", chunkSizeCorrected = " + chunkSizeCorrected );
                   }
   
                   // The spool will put them in a disk event queue, so there is no
  @@ -221,10 +207,6 @@
                       removeNode( last );
                   }
   
  -                if ( debugcmd )
  -                {
  -                    p( "update: After spool, put " + last.ce.getKey() + " on disk cache, map.size() = " + size + ", this.cattr.getMaxObjects() = " + this.cattr.getMaxObjects() + ", chunkSizeCorrected = " + chunkSizeCorrected );
  -                }
                   if ( log.isDebugEnabled() )
                   {
                       log.debug( "update: After spool, put " + last.ce.getKey() + " on disk cache, map.size() = " + size + ", this.cattr.getMaxObjects() = " + this.cattr.getMaxObjects() + ", chunkSizeCorrected = " + chunkSizeCorrected );
  @@ -524,7 +506,7 @@
   //    if ( debugcmd ) {
   //      p( "moveToMemory> key=" + ce.getKey() );
   //    }
  -//    if ( log.logLevel >= log.DEBUG ) {
  +//    if ( log.isDebugEnabled() ) {
   //      StringBuffer params = new StringBuffer();
   //      params.append( "moveToMemory> key=" + ce.getKey() + ", val=" + ce.getVal() );
   //      params.append( "createTime = " + ce.getCreateTime() );
  @@ -566,9 +548,9 @@
        */
       private void removeNode( MemoryElementDescriptor me )
       {
  -        if ( debugR )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "removing node " + me.ce.getKey() );
  +            log.debug( "removing node " + me.ce.getKey() );
           }
   
           if ( me.next == null )
  @@ -734,18 +716,4 @@
               log.debug( "dumpCacheEntries> key=" + me.ce.getKey() + ", val=" + me.ce.getVal() );
           }
       }
  -
  -
  -    ///////////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    public static void p( String s )
  -    {
  -        System.out.println( "LRUMemoryCache: " + s );
  -    }
  -
   }
  -// end LRUMemoryCache
  
  
  
  1.2       +18 -47    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/memory/mru/MRUMemoryCache.java
  
  Index: MRUMemoryCache.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/memory/mru/MRUMemoryCache.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MRUMemoryCache.java	31 Jan 2002 05:10:51 -0000	1.1
  +++ MRUMemoryCache.java	15 Feb 2002 04:33:39 -0000	1.2
  @@ -25,8 +25,8 @@
   import org.apache.stratum.jcs.engine.memory.MemoryElementDescriptor;
   import org.apache.stratum.jcs.engine.memory.behavior.IMemoryCache;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /////////////////////////////////////////////////////
   /**
  @@ -37,13 +37,11 @@
    *@author     asmuts
    *@created    January 15, 2002
    */
  -public class MRUMemoryCache implements IMemoryCache, ICache, Serializable
  +public class MRUMemoryCache 
  +    implements IMemoryCache, ICache, Serializable
   {
  -
  -    private final static boolean debugcmd = false;
  -    // removal
  -    private final static boolean debugR = false;
  -    //true;
  +    private static final Log log = 
  +        LogSource.getInstance( MRUMemoryCache.class );
   
       // MOVE TO MEMORYMANAGER
       String cacheName;
  @@ -74,12 +72,6 @@
   
       private String source_id = "org.apache.stratum.jcs.engine.memory.mru.MRUMemoryCache";
   
  -    // need to convert to log4j
  -    /**
  -     *  Description of the Field
  -     */
  -    protected final static Logger log = LoggerManager.getLogger( MRUMemoryCache.class );
  -
       // The HUB
       ICacheHub hub;
   
  @@ -191,12 +183,9 @@
           }
           else
           {
  -
               // SPOOL LAST -- need to make this a grouping in a queue
  -            if ( debugcmd )
  -            {
  -                p( "IN RAM overflow" );
  -            }
  +
  +            log.debug( "In RAM overflow" );
   
               // write the last item to disk.
               try
  @@ -205,9 +194,9 @@
                   // PUSH 5 TO DISK TO MINIMIZE THE TYPICAL
                   int chunkSizeCorrected = Math.min( size, chunkSize );
   
  -                if ( debugcmd )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "update: About to spool to disk cache, map.size() = " + size + ", this.cattr.getMaxObjects() = " + this.cattr.getMaxObjects() + ", chunkSizeCorrected = " + chunkSizeCorrected );
  +                    log.debug( "update: About to spool to disk cache, map.size() = " + size + ", this.cattr.getMaxObjects() = " + this.cattr.getMaxObjects() + ", chunkSizeCorrected = " + chunkSizeCorrected );
                   }
   
                   // The spool will put them in a disk event queue, so there is no
  @@ -229,11 +218,7 @@
                       }
                   }
   
  -                if ( debugcmd )
  -                {
  -                    p( "update: After spool, map.size() = " + size + ", this.cattr.getMaxObjects() = " + this.cattr.getMaxObjects() + ", chunkSizeCorrected = " + chunkSizeCorrected );
  -                }
  -                if ( log.logLevel >= log.DEBUG )
  +                if ( log.isDebugEnabled() )
                   {
                       log.debug( "update: After spool,  map.size() = " + size + ", this.cattr.getMaxObjects() = " + this.cattr.getMaxObjects() + ", chunkSizeCorrected = " + chunkSizeCorrected );
                   }
  @@ -314,14 +299,14 @@
           try
           {
   
  -            if ( log.logLevel >= log.DEBUG )
  +            if ( log.isDebugEnabled() )
               {
                   log.debug( "get> key=" + key );
                   log.debug( "get> key=" + key.toString() );
               }
   
               ce = ( ICacheElement ) map.get( key );
  -            if ( log.logLevel >= log.DEBUG )
  +            if ( log.isDebugEnabled() )
               {
                   log.debug( "ce =" + ce );
               }
  @@ -335,7 +320,7 @@
                   found = true;
   
                   //ramHit++;
  -                if ( log.logLevel >= log.DEBUG )
  +                if ( log.isDebugEnabled() )
                   {
                       log.debug( cacheName + " -- RAM-HIT for " + key );
                   }
  @@ -354,7 +339,7 @@
               {
                   // Item not found in all caches.
                   //miss++;
  -                if ( log.logLevel >= log.DEBUG )
  +                if ( log.isDebugEnabled() )
                   {
                       log.debug( cacheName + " -- MISS for " + key );
                   }
  @@ -364,7 +349,7 @@
           }
           catch ( Exception e )
           {
  -            log.error( e, "Error handling miss" );
  +            log.error( "Error handling miss", e );
               return null;
           }
   
  @@ -378,7 +363,7 @@
           }
           catch ( Exception e )
           {
  -            log.error( e, "Error making first" );
  +            log.error( "Error making first", e );
               return null;
           }
   
  @@ -405,7 +390,7 @@
           throws IOException
       {
   
  -        if ( log.logLevel >= log.DEBUG )
  +        if ( log.isDebugEnabled() )
           {
               log.debug( "remove> key=" + key );
               //+, nonLocal="+nonLocal);
  @@ -564,18 +549,4 @@
               log.debug( "dumpCacheEntries> key=" + key + ", val=" + ((ICacheElement)map.get(key)).getVal() );
           }
       }
  -
  -
  -    ///////////////////////////////////////////////////
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    public static void p( String s )
  -    {
  -        System.out.println( "MRUMemoryCache: " + s );
  -    }
  -
   }
  -// end LRUMemoryCache
  
  
  
  1.5       +8 -12     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/test/servlet/ListTestCacheServlet.java
  
  Index: ListTestCacheServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/test/servlet/ListTestCacheServlet.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ListTestCacheServlet.java	16 Jan 2002 17:04:47 -0000	1.4
  +++ ListTestCacheServlet.java	15 Feb 2002 04:33:39 -0000	1.5
  @@ -31,8 +31,8 @@
   import org.apache.stratum.jcs.engine.group.GroupCacheManager;
   import org.apache.stratum.jcs.engine.group.GroupCacheManagerFactory;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Description of the Class
  @@ -42,11 +42,9 @@
    */
   public class ListTestCacheServlet extends HttpServlet
   {
  -
  -    /**
  -     *  Description of the Field
  -     */
  -    protected static Logger log;
  +    private static final Log log = 
  +        LogSource.getInstance( ListTestCacheServlet.class );
  +        
       /**
        *  Description of the Field
        */
  @@ -79,8 +77,6 @@
       public void init( ServletConfig config )
           throws ServletException
       {
  -        log = LoggerManager.getLogger( this );
  -
           cacheMgr = GroupCacheManagerFactory.getInstance();
           // use deafult cattr
           zipListCache = cacheMgr.getCache( "zipListCache" );
  @@ -146,7 +142,7 @@
                   paramName = ( String ) e.nextElement();
                   paramValue = req.getParameter( paramName );
                   params.put( paramName, paramValue );
  -                if ( log.DEBUG <= log.logLevel )
  +                if ( log.isDebugEnabled() )
                   {
                       log.debug( paramName + "=" + paramValue );
                   }
  @@ -185,7 +181,7 @@
               {
                   isRedirect = "N";
               }
  -            if ( log.DEBUG <= log.logLevel )
  +            if ( log.isDebugEnabled() )
               {
                   log.debug( "isRedirect = " + isRedirect );
               }
  @@ -193,7 +189,7 @@
               if ( isRedirect.equals( "Y" ) )
               {
                   url = ( String ) params.get( "url" );
  -                if ( log.DEBUG <= log.logLevel )
  +                if ( log.isDebugEnabled() )
                   {
                       log.debug( "url = " + url );
                   }
  
  
  
  1.3       +5 -5      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/test/servlet/SessionExampleServlet.java
  
  Index: SessionExampleServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/test/servlet/SessionExampleServlet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SessionExampleServlet.java	18 Jan 2002 15:21:43 -0000	1.2
  +++ SessionExampleServlet.java	15 Feb 2002 04:33:39 -0000	1.3
  @@ -62,8 +62,8 @@
   // JCS Session Implementation
   import org.apache.stratum.jcs.utils.servlet.session.HttpServletRequestFacade;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Session example using the cache for session replicaiton. Modifed from Tomcat
  @@ -76,9 +76,9 @@
   
   public class SessionExampleServlet extends HttpServlet
   {
  -
  -    private static Logger log = LoggerManager.getLogger( SessionExampleServlet.class );
  -
  +    private static final Log log = 
  +        LogSource.getInstance( SessionExampleServlet.class );
  +        
       ResourceBundle rb = ResourceBundle.getBundle( "LocalStrings" );
   
       /**
  
  
  
  1.4       +5 -4      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/config/IUtilConstants.java
  
  Index: IUtilConstants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/config/IUtilConstants.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- IUtilConstants.java	15 Jan 2002 21:33:35 -0000	1.3
  +++ IUtilConstants.java	15 Feb 2002 04:33:39 -0000	1.4
  @@ -6,8 +6,8 @@
   
   import java.util.Properties;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /////////////////////////////////////////////////////
   /**
  @@ -36,10 +36,11 @@
        */
       final static class Config
       {
  +        private static final Log log = 
  +            LogSource.getInstance( Config.class );
  +        
           private final static String ADMIN_USERID;
           private final static String ADMIN_PASSWORD;
  -
  -        private static Logger log = LoggerManager.getLogger( Config.class );
   
           static
           {
  
  
  
  1.4       +12 -14    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/email/SendJavaMailAttachment.java
  
  Index: SendJavaMailAttachment.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/email/SendJavaMailAttachment.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SendJavaMailAttachment.java	15 Jan 2002 21:33:36 -0000	1.3
  +++ SendJavaMailAttachment.java	15 Feb 2002 04:33:39 -0000	1.4
  @@ -23,8 +23,8 @@
   
   import javax.mail.Message.RecipientType;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /////////////////////////////////////////////
   /**
  @@ -35,19 +35,18 @@
    */
   public class SendJavaMailAttachment
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( SendJavaMailAttachment.class );
  +        
       private String smtpHost = "";
       //PortalEnv.emailHost;
  -    Logger log;
  -    boolean debug = true;
  -
   
       /**
        *  Constructor for the SendJavaMailAttachment object
        */
       public SendJavaMailAttachment()
       {
  -        log = LoggerManager.getLogger( this );
  +        // Empty
       }
   
   
  @@ -69,9 +68,9 @@
           String text = ( String ) params.get( "text" );
           String fullName = ( String ) params.get( "fullName" );
   
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            log.logIt( "fullName = " + fullName );
  +            log.info( "fullName = " + fullName );
           }
   
           String status = "";
  @@ -128,25 +127,24 @@
           catch ( AddressException e )
           {
               status = "There was an error parsing the addresses.";
  -            log.logIt( "Exception e = " + e.toString() );
  +            log.info( "Exception e = " + e.toString() );
           }
           catch ( SendFailedException e )
           {
               status = "There was an error sending the message.";
  -            log.logIt( "Exception e = " + e.toString() );
  +            log.error( "Failed to send message", e );
           }
           catch ( MessagingException e )
           {
               status = "There was an unexpected error.";
  -            log.logIt( "Exception e = " + e.toString() );
  +            log.error( "Failed to send message", e );
           }
           catch ( Exception e )
           {
  -            log.logIt( "Exception e = " + e.toString() );
  +            log.error( "Failed to send message", e );
           }
           finally
           {
  -
               return status;
           }
       }
  
  
  
  1.4       +25 -31    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/email/SendMail.java
  
  Index: SendMail.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/email/SendMail.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SendMail.java	15 Jan 2002 21:33:36 -0000	1.3
  +++ SendMail.java	15 Feb 2002 04:33:39 -0000	1.4
  @@ -13,8 +13,8 @@
   import java.util.StringTokenizer;
   import java.util.Vector;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   ////////////////////////////////////////////////////////////////////////
   /**
  @@ -25,7 +25,9 @@
    */
   public class SendMail
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( SendMail.class );
  +        
       ///////////////////// Constants //////////////////
       private final static int SMTP_PORT = 25;
       private final static char SMTP_ERROR_CODE1 = '4';
  @@ -33,9 +35,6 @@
   
       private final static String server = "";
   
  -    boolean debug = false;
  -    //
  -
       String mailtext = "";
       String maildata = "";
       Vector sessionTrace = new Vector( 20 );
  @@ -45,9 +44,6 @@
       private final static String host = "";
       private final static String domain = "";
   
  -    Logger log = LoggerManager.getLogger( this );
  -
  -
   /////////////////////////////////////////////////////////////////////////////
       /*
        * public static void main( String args[] ) {
  @@ -89,11 +85,9 @@
           String recipientsP = recipients;
           String subjectP = subject;
   
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            log.logIt( "sender = " + senderP + "<br><br>" );
  -            log.logIt( "recipients = " + recipientsP + "" );
  -
  +            log.debug( "sender = " + senderP + ", recipients = " + recipientsP );
           }
   
           String mailtextP = message;
  @@ -117,10 +111,10 @@
           }
           catch ( Exception e )
           {
  -            log.logIt( "Exception thrown when running sendMail = " + e.toString() );
  +            log.error( "Exception thrown when running sendMail", e );
           }
   
  -        log.logIt( "The mail was queued for delivery.\n" + sessionTrace );
  +        log.info( "The mail was queued for delivery" + sessionTrace );
   
       }
       ////////////////// end sendMessage
  @@ -151,9 +145,9 @@
           throws IOException
       {
   
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            log.logIt( "In sendMail: host = " + host + "; domain = " + domain + "; sender = " + senderA + "<br><br>" );
  +            log.debug( "In sendMail: host = " + host + "; domain = " + domain + "; sender = " + senderA + "<br><br>" );
           }
   
           Socket mailSocket;
  @@ -172,25 +166,25 @@
   
           // Get the initial reply from the server.
           readReply( socketIn, sessionTrace );
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            System.out.println( "After initial socket reply from server<br><br>" );
  +            System.out.println( "After initial socket reply from server" );
           }
   
           // Greet the server.
           sendCommand( socketOut, "HELO " + domain, sessionTrace );
           readReply( socketIn, sessionTrace );
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            log.logIt( "After greeting the server<br><br>" );
  +            log.debug( "After greeting the server" );
           }
   
           // Send the sender's address.
           sendCommand( socketOut, "MAIL FROM: " + senderA, sessionTrace );
           readReply( socketIn, sessionTrace );
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            log.logIt( "After sending the from address: sender = " + senderA + "<br><br>" );
  +            log.debug( "After sending the from address: sender = " + senderA );
           }
   
           // Send the list of recipients.
  @@ -199,16 +193,16 @@
           while ( tokenizer.hasMoreElements() )
           {
               String token = tokenizer.nextToken();
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                log.logIt( "token = " + token + "<br><br>" );
  +                log.debug( "token = " + token + "<br><br>" );
               }
               sendCommand( socketOut, "RCPT TO: " + token, sessionTrace );
               readReply( socketIn, sessionTrace );
           }
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            log.logIt( "After sending the to addresses: recipients = " + recipients + "<br><br>" );
  +            log.debug( "After sending the to addresses: recipients = " + recipients );
           }
   
           // Start the data section.
  @@ -222,9 +216,9 @@
           // End the session.
           sendCommand( socketOut, "QUIT", sessionTrace );
           readReply( socketIn, sessionTrace );
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            log.logIt( "After ending the session<br><br>" );
  +            log.debug( "After ending the session" );
           }
       }
   
  @@ -244,7 +238,7 @@
   
           out.writeBytes( command + "\r\n" );
           sessionTrace.addElement( command );
  -        log.logIt( command );
  +        log.info( command );
       }
   
   
  @@ -266,7 +260,7 @@
           reply = reader.readLine();
           statusCode = reply.charAt( 0 );
           sessionTrace.addElement( reply );
  -        log.logIt( reply );
  +        log.info( reply );
   
           if ( ( statusCode == SMTP_ERROR_CODE1 ) |
               ( statusCode == SMTP_ERROR_CODE2 ) )
  
  
  
  1.4       +5 -5      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/net/LocalHost.java
  
  Index: LocalHost.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/net/LocalHost.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LocalHost.java	15 Jan 2002 21:33:36 -0000	1.3
  +++ LocalHost.java	15 Feb 2002 04:33:40 -0000	1.4
  @@ -3,8 +3,8 @@
   import java.net.InetAddress;
   import java.net.UnknownHostException;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Description of the Class
  @@ -14,15 +14,15 @@
    */
   public class LocalHost
   {
  -    private static Logger log;
  -
  +    private static final Log log = 
  +        LogSource.getInstance( LocalHost.class );
   
       /**
        *  Constructor for the LocalHost object
        */
       public LocalHost()
       {
  -        log = LoggerManager.getLogger( this );
  +        // Empty
       }
   
       ///////////////////////////////////////////
  
  
  
  1.4       +4 -7      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/reuse/HashMapPoolManager.java
  
  Index: HashMapPoolManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/reuse/HashMapPoolManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HashMapPoolManager.java	15 Jan 2002 21:33:37 -0000	1.3
  +++ HashMapPoolManager.java	15 Feb 2002 04:33:40 -0000	1.4
  @@ -2,8 +2,8 @@
   
   import java.util.HashMap;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Very simple utility class to be sued by proxy servlets that pass values by
  @@ -15,8 +15,8 @@
    */
   public class HashMapPoolManager
   {
  -
  -    Logger log;
  +    private static final Log log = 
  +        LogSource.getInstance( HashMapPoolManager.class );
   
       HashMap[] pool;
       boolean[] inUse;
  @@ -63,9 +63,6 @@
        */
       public HashMapPoolManager( int initialPoolSize )
       {
  -
  -        log = LoggerManager.getLogger( this );
  -
           log.info( "initialPoolSize = " + initialPoolSize );
   
           pool = new HashMap[initialPoolSize];
  
  
  
  1.4       +4 -8      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/reuse/HashtablePoolManager.java
  
  Index: HashtablePoolManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/reuse/HashtablePoolManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HashtablePoolManager.java	15 Jan 2002 21:33:37 -0000	1.3
  +++ HashtablePoolManager.java	15 Feb 2002 04:33:40 -0000	1.4
  @@ -2,8 +2,8 @@
   
   import java.util.Hashtable;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  Very simple utility class to be sued by proxy servlets that pass values by
  @@ -15,8 +15,8 @@
    */
   public class HashtablePoolManager
   {
  -
  -    Logger log;
  +    private static final Log log = 
  +        LogSource.getInstance( HashtablePoolManager.class );
   
       Hashtable[] pool;
       boolean[] inUse;
  @@ -64,10 +64,6 @@
        */
       public HashtablePoolManager( int initialPoolSize )
       {
  -
  -        LoggerManager lm = LoggerManager.getInstance();
  -        log = lm.getLogger( this );
  -
           log.info( "initialPoolSize = " + initialPoolSize );
   
           pool = new Hashtable[initialPoolSize];
  
  
  
  1.4       +34 -51    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/reuse/ReadWriteLock.java
  
  Index: ReadWriteLock.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/reuse/ReadWriteLock.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ReadWriteLock.java	15 Jan 2002 21:33:37 -0000	1.3
  +++ ReadWriteLock.java	15 Feb 2002 04:33:40 -0000	1.4
  @@ -3,6 +3,9 @@
   
   import java.util.ArrayList;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
  +
   /**
    *  This class coordinates concurrent calls to an object's get and set methods
    *  so that calls to the object set methods do not interfere with each other or
  @@ -20,10 +23,9 @@
    */
   class ReadWriteLock
   {
  -    //////////////// debug MUST BE SET TO false in production! ///////////////////
  -    private boolean debug = false;
  -    //true;
  -
  +    private static final Log log = 
  +        LogSource.getInstance( ReadWriteLockManager.class );
  +    
       /**
        *  Number of threads waiting to read.
        */
  @@ -71,14 +73,13 @@
           waitingForReadLock++;
           while ( writeLockedThread != null )
           {
  -            p( "readLock wait" );
  +            log.debug( "readLock wait" );
               wait();
  -            p( "wake up from readLock wait" );
  -        }
  -        if ( debug )
  -        {
  -            p( "readLock acquired" );
  +            log.debug( "wake up from readLock wait" );
           }
  +        
  +        log.debug( "readLock acquired" );
  +        
           waitingForReadLock--;
           outstandingReadLocks++;
       }
  @@ -101,10 +102,9 @@
               {
                   writeLockedThread = Thread.currentThread();
                   outstandingWriteLocks++;
  -                if ( debug )
  -                {
  -                    p( "writeLock acquired without waiting" );
  -                }
  +                
  +                log.debug( "writeLock acquired without waiting" );
  +                
                   return;
               }
               if ( writeLockedThread == thisThread )
  @@ -118,15 +118,13 @@
           {
               while ( thisThread != writeLockedThread )
               {
  -                p( "writeLock wait" );
  +                log.debug( "writeLock wait" );
                   // set this so if there is an error the app will not completely die!
                   thisThread.wait( 2000 );
  -                p( "wake up from writeLock wait" );
  -            }
  -            if ( debug )
  -            {
  -                p( "writeLock acquired" );
  +                log.debug( "wake up from writeLock wait" );
               }
  +            
  +            log.debug( "writeLock acquired" );
           }
           synchronized ( this )
           {
  @@ -151,24 +149,24 @@
               if ( outstandingReadLocks == 0 && waitingForWriteLock.size() > 0 )
               {
                   writeLockedThread = ( Thread ) waitingForWriteLock.get( 0 );
  -                if ( debug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "readLock released and before notifying a write lock waiting thread "
  +                    log.debug( "readLock released and before notifying a write lock waiting thread "
                            + writeLockedThread );
                   }
                   synchronized ( writeLockedThread )
                   {
                       writeLockedThread.notifyAll();
                   }
  -                if ( debug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "readLock released and after  notifying a write lock waiting thread "
  +                    log.debug( "readLock released and after  notifying a write lock waiting thread "
                            + writeLockedThread );
                   }
               }
  -            else if ( debug )
  +            else if ( log.isDebugEnabled() )
               {
  -                p( "readLock released without fuss" );
  +                log.debug( "readLock released without fuss" );
               }
               return;
           }
  @@ -177,24 +175,24 @@
               outstandingWriteLocks--;
               if ( outstandingWriteLocks > 0 )
               {
  -                p( "writeLock released for a nested writeLock request." );
  +                log.debug( "writeLock released for a nested writeLock request." );
                   return;
               }
               if ( outstandingReadLocks == 0 && waitingForWriteLock.size() > 0 )
               {
                   writeLockedThread = ( Thread ) waitingForWriteLock.get( 0 );
  -                if ( debug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "writeLock released and before notifying a write lock waiting thread "
  +                    log.debug( "writeLock released and before notifying a write lock waiting thread "
                            + writeLockedThread );
                   }
                   synchronized ( writeLockedThread )
                   {
                       writeLockedThread.notifyAll();
                   }
  -                if ( debug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "writeLock released and after notifying a write lock waiting thread "
  +                    log.debug( "writeLock released and after notifying a write lock waiting thread "
                            + writeLockedThread );
                   }
               }
  @@ -203,21 +201,21 @@
                   writeLockedThread = null;
                   if ( waitingForReadLock > 0 )
                   {
  -                    if ( debug )
  +                    if ( log.isDebugEnabled() )
                       {
  -                        p( "writeLock released and notify all read lock waiting threads." );
  +                        log.debug( "writeLock released and notify all read lock waiting threads." );
                       }
                       notifyAll();
                   }
  -                else if ( debug )
  +                else if ( log.isDebugEnabled() )
                   {
  -                    p( "writeLock released without fuss." );
  +                    log.debug( "writeLock released without fuss." );
                   }
               }
               return;
           }
           //////////////// debug MUST BE SET TO false in production! ///////////////////
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
               try
               {
  @@ -227,21 +225,6 @@
               {}
           }
           throw new IllegalStateException( "Thread does not have lock" );
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        if ( debug )
  -        {
  -            System.out.println( "ReadWriteLock: " + Thread.currentThread() + ">>" +
  -                s );
  -        }
       }
   }
   
  
  
  
  1.4       +17 -30    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/reuse/ReadWriteLockManager.java
  
  Index: ReadWriteLockManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/reuse/ReadWriteLockManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ReadWriteLockManager.java	15 Jan 2002 21:33:37 -0000	1.3
  +++ ReadWriteLockManager.java	15 Feb 2002 04:33:40 -0000	1.4
  @@ -6,6 +6,9 @@
   import org.apache.stratum.jcs.utils.reuse.RwLockGC;
   import org.apache.stratum.jcs.utils.reuse.RwLockHolder;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
  +
   /**
    *  The Generic ReadWriteLock Manager for various resources.
    *
  @@ -14,12 +17,9 @@
    */
   public abstract class ReadWriteLockManager
   {
  -
  -    /**
  -     *  Description of the Field
  -     */
  -    public final static boolean debug = false;
  -
  +    private static final Log log = 
  +        LogSource.getInstance( ReadWriteLockManager.class );
  +        
       /**
        *  Used to asynchronously remove unused RwLockHolder objects managed ty
        *  this manager.
  @@ -31,7 +31,6 @@
        */
       private String clsname;
   
  -
       /**
        *  Places a read lock on the specified resource.
        *
  @@ -71,16 +70,16 @@
           if ( holder == null )
           {
   
  -            p( "Method done of " + getClass().getName() + " invoked without an outstanding lock; id=" + id );
  +            log.debug( "Method done of " + getClass().getName() + " invoked without an outstanding lock; id=" + id );
               //System.exit(1);
   
               throw new IllegalStateException( "Method done of " + getClass().getName()
                    + " invoked without an outstanding lock; id=" + id );
           }
           holder.rwlock.done();
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "lock done for id = " + id );
  +            log.debug( "lock done for id = " + id );
           }
           // Somehow if we don't synchronize while changing the count,
           // the count went down below zero!
  @@ -127,9 +126,9 @@
       private void lock( String id, boolean isWrite )
           throws InterruptedException
       {
  -        if ( debug )
  +        if ( log.isDebugEnabled() )
           {
  -            p( "about to get lock, isWrite=" + isWrite + " for id = " + id );
  +            log.debug( "about to get lock, isWrite=" + isWrite + " for id = " + id );
           }
           RwLockHolder holder;
           Hashtable ht = getLocks();
  @@ -152,9 +151,9 @@
               {
                   // Lock already exists.  So just use it.
                   holder.lcount++;
  -                if ( debug )
  +                if ( log.isDebugEnabled() )
                   {
  -                    p( "++ holder.lcount=" + holder.lcount + ", isWrite=" + isWrite + " for id = " + id );
  +                    log.debug( "++ holder.lcount=" + holder.lcount + ", isWrite=" + isWrite + " for id = " + id );
                   }
               }
           }
  @@ -162,9 +161,9 @@
           {
               // Lock does not exist.  So create a new one.
               RwLockHolder newHolder = new RwLockHolder( new ReadWriteLock() );
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                p( "holder is null, isWrite=" + isWrite );
  +                log.debug( "holder is null, isWrite=" + isWrite );
               }
               synchronized ( ht )
               {
  @@ -183,9 +182,9 @@
                   // no concurrency issue -- the new lock is now used.
                   holder = newHolder;
               }
  -            if ( debug )
  +            if ( log.isDebugEnabled() )
               {
  -                p( ( isWrite ? "Write" : "Read" ) + " lock created for " + id );
  +                log.debug( ( isWrite ? "Write" : "Read" ) + " lock created for " + id );
               }
           }
           // Be careful not to put the following code into a synchronized block.
  @@ -219,18 +218,6 @@
       {
           clsname = getClass().getName();
           clsname = clsname.substring( clsname.lastIndexOf( '.' ) + 1 );
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        //    System.err.println(clsname + "#" + Thread.currentThread() + ">>" + s);
  -        System.err.println( ">> " + s );
       }
   }
   
  
  
  
  1.4       +5 -14     jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/reuse/RwLockGC.java
  
  Index: RwLockGC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/reuse/RwLockGC.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RwLockGC.java	15 Jan 2002 21:33:37 -0000	1.3
  +++ RwLockGC.java	15 Feb 2002 04:33:40 -0000	1.4
  @@ -6,8 +6,8 @@
   import java.util.Set;
   import java.util.Map.Entry;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   import org.apache.stratum.jcs.utils.reuse.RwLockHolder;
   
  @@ -20,10 +20,12 @@
    */
   public class RwLockGC extends Thread
   {
  +    private final static Log log = LogSource.getInstance( RwLockGC.class );
  +    
       private final Hashtable ht;
       private final static long IDLE_PERIOD = 60 * 1000;
       // 60 seconds.
  -    private Logger log = LoggerManager.getInstance().getLogger( this );
  +
       private boolean clean = true;
   
   
  @@ -138,17 +140,6 @@
                   clean = false;
               }
           }
  -    }
  -
  -
  -    /**
  -     *  Description of the Method
  -     *
  -     *@param  s  Description of the Parameter
  -     */
  -    private void p( String s )
  -    {
  -        System.out.println( "RwLockGC:" + s );
       }
   }
   
  
  
  
  1.4       +5 -4      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/BasicHttpAuthenticator.java
  
  Index: BasicHttpAuthenticator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/BasicHttpAuthenticator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BasicHttpAuthenticator.java	15 Jan 2002 21:33:37 -0000	1.3
  +++ BasicHttpAuthenticator.java	15 Feb 2002 04:33:40 -0000	1.4
  @@ -9,8 +9,8 @@
   
   import org.apache.stratum.jcs.utils.config.IUtilConstants;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   import sun.misc.BASE64Decoder;
   
  @@ -22,11 +22,13 @@
    */
   public class BasicHttpAuthenticator
   {
  +    private static final Log log = 
  +        LogSource.getInstance( BasicHttpAuthenticator.class );
  +        
       /**
        *  Contains the "WWW-Authenticate" http response header.
        */
       private final String wwwAuthHeader;
  -    private Logger log;
   
   
       /**
  @@ -36,7 +38,6 @@
       public BasicHttpAuthenticator( String jcs )
       {
           this.wwwAuthHeader = "BASIC jcs=\"" + jcs + "\"";
  -        log = LoggerManager.getLogger( this );
       }
   
   
  
  
  
  1.6       +6 -4      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/session/DistSession.java
  
  Index: DistSession.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/session/DistSession.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DistSession.java	18 Jan 2002 02:24:58 -0000	1.5
  +++ DistSession.java	15 Feb 2002 04:33:40 -0000	1.6
  @@ -13,8 +13,8 @@
   
   import org.apache.stratum.jcs.access.GroupCacheAccess;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   import org.apache.stratum.jcs.utils.reuse.ICleanForPool;
   
  @@ -30,6 +30,9 @@
   public class DistSession
       implements HttpSession, ICleanForPool, ISessionConstants
   {
  +    private static final Log log = 
  +        LogSource.getInstance( DistSession.class );
  +        
       private static boolean SET_ATTR_INVOCATION = true;
       private static boolean REMOVE_ATTR_INVOCATION = false;
   
  @@ -38,7 +41,6 @@
       private String session_id;
       private SessionInfo sessInfo;
   
  -    private Logger log;
       private GroupCacheAccess sessCache;
   
       private boolean isNew;
  @@ -66,7 +68,7 @@
       public DistSession(ServletContext context)
       {
           this.context = context;
  -        log = LoggerManager.getLogger( this );
  +
           try
           {
               sessCache = GroupCacheAccess.getGroupAccess( SESS_CACHE_NAME );
  
  
  
  1.5       +8 -7      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/session/DistSessionGC.java
  
  Index: DistSessionGC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/session/DistSessionGC.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DistSessionGC.java	16 Jan 2002 05:32:46 -0000	1.4
  +++ DistSessionGC.java	15 Feb 2002 04:33:40 -0000	1.5
  @@ -3,8 +3,8 @@
   
   import java.util.Set;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   import org.apache.stratum.jcs.utils.servlet.session.DistSession;
   import org.apache.stratum.jcs.utils.servlet.session.ISessionConstants;
  @@ -17,11 +17,12 @@
    */
   class DistSessionGC extends Thread implements ISessionConstants
   {
  +    private static final Log log = 
  +        LogSource.getInstance( DistSessionGC.class );
  +    
       private final static long IDLE_PERIOD = DFLT_INACTIVE_INTERVAL;
  -    private static Logger log = LoggerManager.getInstance().getLogger( DistSessionGC.class );
       private final Set sessIdSet;
   
  -
       /**
        *  Constructs with the given set of session id's.
        *
  @@ -62,7 +63,7 @@
                   {
                       if ( sessIdSet.size() == 0 )
                       {
  -                        if ( log.DEBUG <= log.logLevel )
  +                        if ( log.isDebugEnabled() )
                           {
                               log.debug( "entering into a wait state" );
                           }
  @@ -80,7 +81,7 @@
               // Time driven mode: sleep between each round of garbage collection.
               try
               {
  -                if ( log.DEBUG <= log.logLevel )
  +                if ( log.isDebugEnabled() )
                   {
                       log.debug( "sessIdSet.size()=" + sessIdSet.size() );
                       log.debug( "sleeping for " + IDLE_PERIOD );
  @@ -98,7 +99,7 @@
               {
                   sessIds = ( String[] ) sessIdSet.toArray( new String[0] );
               }
  -            if ( log.DEBUG <= log.logLevel )
  +            if ( log.isDebugEnabled() )
               {
                   log.debug( "garbage collecting..." );
               }
  
  
  
  1.4       +4 -7      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/session/DistSessionPoolManager.java
  
  Index: DistSessionPoolManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/session/DistSessionPoolManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DistSessionPoolManager.java	15 Jan 2002 21:33:37 -0000	1.3
  +++ DistSessionPoolManager.java	15 Feb 2002 04:33:40 -0000	1.4
  @@ -1,7 +1,7 @@
   package org.apache.stratum.jcs.utils.servlet.session;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   ///////////////////////////////////////////////////////
   /**
  @@ -12,8 +12,8 @@
    */
   public class DistSessionPoolManager
   {
  -
  -    Logger log;
  +    private static final Log log = 
  +        LogSource.getInstance( DistSessionPoolManager.class );
   
       DistSession[] pool;
       boolean[] inUse;
  @@ -60,9 +60,6 @@
        */
       public DistSessionPoolManager( int initialPoolSize )
       {
  -
  -        log = LoggerManager.getLogger( this );
  -
           log.info( "initialPoolSize = " + initialPoolSize );
   
           pool = new DistSession[initialPoolSize];
  
  
  
  1.5       +8 -6      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/session/DistSessionTracker.java
  
  Index: DistSessionTracker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/servlet/session/DistSessionTracker.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DistSessionTracker.java	16 Jan 2002 05:32:46 -0000	1.4
  +++ DistSessionTracker.java	15 Feb 2002 04:33:40 -0000	1.5
  @@ -9,8 +9,8 @@
   import javax.servlet.http.HttpServletResponse;
   import javax.servlet.http.HttpSession;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   import org.apache.stratum.jcs.utils.servlet.session.DistSession;
   import org.apache.stratum.jcs.utils.servlet.session.DistSessionGC;
  @@ -24,17 +24,19 @@
    *
    *@author     Aaron Smuts
    *@created    January 15, 2002
  - *@version    $Revision: 1.4 $ $Date: 2002/01/16 05:32:46 $
  + *@version    $Revision: 1.5 $ $Date: 2002/02/15 04:33:40 $
    */
   
   public class DistSessionTracker implements ISessionConstants
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( DistSessionTracker.class );
  +        
       /**
        *  Description of the Field
        */
       public final static String SESSION_COOKIE_NAME = "SESSION_ID";
  -    private static Logger log = LoggerManager.getLogger( DistSessionTracker.class );
  +
       private static DistSessionPoolManager dsMgr = new DistSessionPoolManager( 200 );
       /**
        *  Description of the Field
  @@ -142,7 +144,7 @@
               c.setPath( "/" );
               c.setMaxAge( -1 );
               res.addCookie( c );
  -            if ( log.INFO <= log.logLevel )
  +            if ( log.isInfoEnabled() )
               {
                   log.info( "created cookie session with session=" + sess );
               }
  
  
  
  1.3       +16 -28    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/threads/ThreadPool.java
  
  Index: ThreadPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/threads/ThreadPool.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ThreadPool.java	18 Jan 2002 15:38:15 -0000	1.2
  +++ ThreadPool.java	15 Feb 2002 04:33:40 -0000	1.3
  @@ -1,9 +1,9 @@
   package org.apache.stratum.jcs.utils.threads;
   
   /*
  - * $Header: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/threads/ThreadPool.java,v 1.2 2002/01/18 15:38:15 asmuts Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/01/18 15:38:15 $
  + * $Header: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/threads/ThreadPool.java,v 1.3 2002/02/15 04:33:40 jtaylor Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/02/15 04:33:40 $
    *
    * ====================================================================
    *
  @@ -67,8 +67,8 @@
   import java.util.*;
   import java.io.*;
   
  -import org.apache.stratum.jcs.utils.log.Logger;
  -import org.apache.stratum.jcs.utils.log.LoggerManager;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
   
   /**
    *  A thread pool that is trying to copy the apache process management. asmuts
  @@ -81,7 +81,9 @@
    */
   public class ThreadPool
   {
  -
  +    private static final Log log = 
  +        LogSource.getInstance( ThreadPool.class );
  +        
       /*
        * Default values ...
        */
  @@ -166,13 +168,6 @@
        */
       protected boolean stopThePool;
   
  -    static int debug = 0;
  -
  -    /**
  -     *  Helper object for logging
  -     */
  -    private static Logger log = LoggerManager.getLogger( ThreadPool.class );
  -
       /**
        *  Constructor for the ThreadPool object
        */
  @@ -321,7 +316,7 @@
                           // do we say pool.interrupt().
                           catch ( InterruptedException e )
                           {
  -                            log.error( e, "Unexpected exception" );
  +                            log.error( "Unexpected exception", e );
                           }
   
                           // Pool was stopped. Get away of the pool.
  @@ -350,7 +345,7 @@
        *@param  maxThreads          Description of the Parameter
        *@param  log                 Description of the Parameter
        */
  -    public static void logFull( Logger log, int currentThreadCount, int maxThreads )
  +    public static void logFull( Log log, int currentThreadCount, int maxThreads )
       {
           if ( logfull )
           {
  @@ -690,18 +685,13 @@
                       }
                       if ( toRun == null )
                       {
  -                        if ( p.debug > 0 )
  -                        {
  -                            p.log( "No toRun ???" );
  -                        }
  +                        log.debug( "No toRun ???" );
                       }
   
                       if ( shouldTerminate )
                       {
  -                        if ( p.debug > 0 )
  -                        {
  -                            p.log( "Terminate" );
  -                        }
  +                        log.debug( "Terminate" );
  +                        
                           break;
                       }
   
  @@ -712,10 +702,8 @@
                       {
                           if ( noThData )
                           {
  -                            if ( p.debug > 0 )
  -                            {
  -                                p.log( "Getting new thread data" );
  -                            }
  +                            log.debug( "Getting new thread data" );
  +                            
                               thData = toRun.getInitData();
                               noThData = false;
                           }
  @@ -766,7 +754,7 @@
                        * for the wait operation
                        */
                       // can never happen, since we don't call interrupt
  -                    log.error( ie, "Unexpected exception" );
  +                    log.error( "Unexpected exception", ie );
                   }
               }
           }
  
  
  

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


izombie

Posted by Aaron Smuts <aa...@verizon.net>.
Izombie could go in org.apache.stratum.jcs.engine.behavior


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


RE: attributes

Posted by Aaron Smuts <aa...@verizon.net>.
It bugs me too.  I just never did it and still haven't.  It got that way
because of the jcache api, which I don't care that much about anymore.

Aaron

> -----Original Message-----
> From: James Taylor [mailto:jtaylor@4lane.com]
> Sent: Saturday, February 16, 2002 5:07 PM
> To: 'Turbine Developers List'
> Subject: Re: attributes
> 
> +1 (billion if I could, that's been buggin me for a while =)
> 
> -- jt
> 
> On Sat, 2002-02-16 at 17:10, Aaron Smuts wrote:
> >
> >
> > There is a confusing naming convention in the cache. Attributes is
for
> > elements and cache attributes is for CacheAttributes.  I think
> > Attributes should become ElementAttributes and all the methods
around
> > element attributes should have the word element in the method name.
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:turbine-dev-
> unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:turbine-dev-
> help@jakarta.apache.org>
> >
> >
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-dev-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:turbine-dev-
> help@jakarta.apache.org>


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


Re: attributes

Posted by James Taylor <jt...@4lane.com>.
+1 (billion if I could, that's been buggin me for a while =)

-- jt

On Sat, 2002-02-16 at 17:10, Aaron Smuts wrote:
> 
> 
> There is a confusing naming convention in the cache. Attributes is for
> elements and cache attributes is for CacheAttributes.  I think
> Attributes should become ElementAttributes and all the methods around
> element attributes should have the word element in the method name.
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 



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


attributes

Posted by Aaron Smuts <aa...@verizon.net>.

There is a confusing naming convention in the cache. Attributes is for
elements and cache attributes is for CacheAttributes.  I think
Attributes should become ElementAttributes and all the methods around
element attributes should have the word element in the method name.


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


RE: cvs commit: jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/threads ThreadPool.java

Posted by James Taylor <jt...@4lane.com>.
On Fri, 2002-02-15 at 00:31, Aaron Smuts wrote:
> That was amazing!

=]

> Yes, almost everything is debug level trace logging.  The code would be
> far cleaner without much of it.  There may be some places where it will
> have to stay for a bit, primarily in the group cache.  The locking got
> to be a pain with the nested method calls.  I think I cleaned it up a
> bit a while back.

We should definitely remove redundant logging and things that can easily
be done with aspectj, but otherwise I have no problem with keeping a lot
of the debug level stuff in there. What I'd like to see is enough of it
pushed up to info that one can run at debug rather than info, and still
get a general idea of what is happening. 

> I guess you are much more familiar with the code now.  The commit email
> was half a MB.

Yeah. What helps a lot is understanding better how it is partitioned,
and what responsibilities the major packages have. We should probably
get some package level documentation in there, I think that would help
others a lot.

Thanks,
James


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


RE: cvs commit: jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/utils/threads ThreadPool.java

Posted by Aaron Smuts <aa...@verizon.net>.
That was amazing!

Yes, almost everything is debug level trace logging.  The code would be
far cleaner without much of it.  There may be some places where it will
have to stay for a bit, primarily in the group cache.  The locking got
to be a pain with the nested method calls.  I think I cleaned it up a
bit a while back.

I want to get good enough at the aspect stuff to use it effectively.

I guess you are much more familiar with the code now.  The commit email
was half a MB.

Again, damn!

Aaron


 
 


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