You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-dev@jakarta.apache.org by as...@apache.org on 2005/09/12 06:27:45 UTC

svn commit: r280252 - in /jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary: javagroups/ lateral/ lateral/behavior/ lateral/javagroups/ lateral/javagroups/behavior/ lateral/javagroups/utils/ lateral/socket/tcp/ lateral/socket/tcp/discovery/

Author: asmuts
Date: Sun Sep 11 21:27:25 2005
New Revision: 280252

URL: http://svn.apache.org/viewcvs?rev=280252&view=rev
Log:
Refactoring lateral manager and factory.  The old model was to have one factory
and mananger know about all types of lateral.  This created too many dependencies 
and forced lots of ad hoc logic into the managers.  The new model will have
each lateral responsible for its own factory and manager.  This keeps things clean
and will allow laterals to ahve their own configuration settings.  The old
attributes object had stuff for every lateral, but only a small subset applied
to any given lateral.  This is a work in progress but it is almost done.  

The new cache.ccf config for laterals will not be backward compatible, but the 
changes will be minor.  When it is done the version will be 1.3.  After more 
testing, this will be the release candidate major version.

I'm moving the javagroups stuff into to jdk1.4 specific jar.  

The refactoring should be done in a few days.  This will allow us to release a 1.3 core library
and a 1.4 extension jar.  

Added:
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAbstractFactory.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAbstractManager.java
      - copied, changed from r264929, jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheManager.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheManager.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheManager.java
Removed:
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/javagroups/
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheFactory.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheManager.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/JGConnectionHolder.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralCacheJGListener.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralGroupCacheJGListener.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiver.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiverConnection.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGSender.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGService.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/behavior/
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/utils/
Modified:
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheMonitor.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheRestore.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/discovery/UDPDiscoveryReceiver.java

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java?rev=280252&r1=280251&r2=280252&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java Sun Sep 11 21:27:25 2005
@@ -22,7 +22,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
 import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
 import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
 import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheService;
@@ -50,17 +49,21 @@
     /** either http, socket.udp, or socket.tcp can set in config */
     private ILateralCacheService lateral;
 
+    private LateralCacheMonitor monitor;
+    
     /**
      * Constructor for the LateralCache object
      * 
      * @param cattr
      * @param lateral
+     * @param monitor
      */
-    protected LateralCache( ILateralCacheAttributes cattr, ILateralCacheService lateral )
+    public LateralCache( ILateralCacheAttributes cattr, ILateralCacheService lateral, LateralCacheMonitor monitor )
     {
         this.cacheName = cattr.getCacheName();
         this.cattr = cattr;
         this.lateral = lateral;
+        this.monitor = monitor;
     }
 
     /**
@@ -280,7 +283,7 @@
         // may want to flush if region specifies
         // Notify the cache monitor about the error, and kick off the recovery
         // process.
-        LateralCacheMonitor.getInstance().notifyError();
+        monitor.notifyError();
 
         // could stop the net serach if it is built and try to reconnect?
         if ( ex instanceof IOException )

Added: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAbstractFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAbstractFactory.java?rev=280252&view=auto
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAbstractFactory.java (added)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAbstractFactory.java Sun Sep 11 21:27:25 2005
@@ -0,0 +1,82 @@
+package org.apache.jcs.auxiliary.lateral;
+
+import org.apache.jcs.auxiliary.AuxiliaryCache;
+import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
+import org.apache.jcs.auxiliary.AuxiliaryCacheFactory;
+import org.apache.jcs.engine.behavior.ICompositeCacheManager;
+
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Particular lateral caches should define their own factory.  It is 
+ * not necessary to extend this base factory, but it can be useful.
+ * <p>
+ * The old factory tried to handle all types of laterals.  It was
+ * gettting cluttered by ad hoc if statements.  Since the javagroups
+ * lateral was jdk1.4 dependent it had to be moved.  As such, the
+ * old factory could no longer import it.  This motivated the change.
+ * <p>
+ * This abstraction layer should keep things cleaner.  
+ * 
+ * @author Aaron Smuts
+ *
+ */
+public abstract class LateralCacheAbstractFactory
+	implements AuxiliaryCacheFactory
+{
+
+    private String name;
+    
+    /* (non-Javadoc)
+     * @see org.apache.jcs.auxiliary.AuxiliaryCacheFactory#createCache(org.apache.jcs.auxiliary.AuxiliaryCacheAttributes, org.apache.jcs.engine.behavior.ICompositeCacheManager)
+     */
+    public abstract AuxiliaryCache createCache( AuxiliaryCacheAttributes attr, ICompositeCacheManager cacheMgr );
+
+    /**
+     * Makes sure a listener gets created. It will get monitored as soon as it
+     * is used.
+     * <p>
+     * This should be called by create cache.
+     * 
+     * @param lac, LateralCacheAttributes
+     * @param cacheMgr
+     */
+    public abstract void createListener( LateralCacheAttributes lac, ICompositeCacheManager cacheMgr );
+    
+    
+    /**
+     * Gets the name attribute of the LateralCacheFactory object
+     * 
+     * @return The name value
+     */
+    public String getName()
+    {
+        return this.name;
+    }
+
+    /**
+     * Sets the name attribute of the LateralCacheFactory object
+     * 
+     * @param name
+     *            The new name value
+     */
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
+}

Copied: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAbstractManager.java (from r264929, jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheManager.java)
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAbstractManager.java?p2=jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAbstractManager.java&p1=jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheManager.java&r1=264929&r2=280252&rev=280252&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheManager.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAbstractManager.java Sun Sep 11 21:27:25 2005
@@ -23,17 +23,12 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.jcs.auxiliary.AuxiliaryCacheManager;
 import org.apache.jcs.auxiliary.AuxiliaryCache;
 import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
 import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheListener;
+import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheManager;
 import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheObserver;
 import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheService;
-import org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPService;
-import org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPListener;
-import org.apache.jcs.auxiliary.lateral.javagroups.LateralJGService;
-import org.apache.jcs.auxiliary.lateral.javagroups.LateralCacheJGListener;
-import org.apache.jcs.engine.behavior.ICompositeCacheManager;
 
 /**
  * Creates lateral caches. Lateral caches are primarily used for removing non
@@ -48,25 +43,19 @@
  * @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 AuxiliaryCacheManager
+public abstract class LateralCacheAbstractManager
+    implements ILateralCacheManager
 {
-    private final static Log log = LogFactory.getLog( LateralCacheManager.class );
-
-    private static LateralCacheMonitor monitor;
-
-    final static Map instances = new HashMap();
+    private final static Log log = LogFactory.getLog( LateralCacheAbstractManager.class );
 
     // each manager instance has caches
-    final Map caches = new HashMap();
+    protected final Map caches = new HashMap();
 
     /**
      * Description of the Field
      */
     protected ILateralCacheAttributes lca;
 
-    private int clients;
-
     /**
      * Handle to the lateral cache service; or a zombie handle if failed to
      * connect.
@@ -79,120 +68,6 @@
      */
     private LateralCacheWatchRepairable lateralWatch;
 
-    private ICompositeCacheManager cacheMgr;
-    
-    /**
-     * Returns an instance of the LateralCacheManager.
-     * 
-     * @param lca
-     * @param cacheMgr  this allows the auxiliary to be passed a cache manager.
-     * @return
-     */
-    public static LateralCacheManager getInstance( ILateralCacheAttributes lca, ICompositeCacheManager cacheMgr )
-    {
-        LateralCacheManager ins = (LateralCacheManager) instances.get( lca.toString() );
-        synchronized ( instances )
-        {
-            if ( ins == null )
-            {
-                log.info( "Instance for [" + lca.toString() + "] is null, creating" );
-
-                ins = (LateralCacheManager) instances.get( lca.toString() );
-                if ( ins == null )
-                {
-                    ins = new LateralCacheManager( lca, cacheMgr );
-                    instances.put( lca.toString(), ins );
-                }
-            }
-        }
-
-        ins.clients++;
-        // Fires up the monitoring daemon.
-        if ( monitor == null )
-        {
-            monitor = LateralCacheMonitor.getInstance();
-            // Should never be null
-            if ( monitor != null )
-            {
-                Thread t = new Thread( monitor );
-                t.setDaemon( true );
-                t.start();
-            }
-        }
-        return ins;
-    }
-
-    /**
-     * Constructor for the LateralCacheManager object
-     * 
-     * @param lcaA
-     * @param cacheMgr
-     */
-    private LateralCacheManager( ILateralCacheAttributes lcaA, ICompositeCacheManager cacheMgr )
-    {
-        this.lca = lcaA;
-
-        this.cacheMgr = cacheMgr;
-        
-        if ( log.isDebugEnabled() )
-        {
-            log.debug( "Creating lateral cache service, lca = " + this.lca );
-        }
-
-        // need to create the service based on the type
-
-        try
-        {
-            if ( this.lca.getTransmissionType() == ILateralCacheAttributes.TCP )
-            {
-                log.debug( "Creating TCP service" );
-                log.info( "Creating TCP service, lca = " + this.lca );
-
-                this.lateralService = new LateralTCPService( this.lca );
-            }
-            else if ( this.lca.getTransmissionType() == ILateralCacheAttributes.JAVAGROUPS )
-            {
-                log.debug( "Creating JAVAGROUPS service" );
-
-                this.lateralService = new LateralJGService( this.lca );
-            }
-
-            else
-            {
-                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" );
-
-                throw new Exception( "No service created for lateral cache." );
-            }
-
-            this.lateralWatch = new LateralCacheWatchRepairable();
-            this.lateralWatch.setCacheWatch( new ZombieLateralCacheWatch() );
-
-        }
-        catch ( Exception ex )
-        {
-            // Failed to connect to the lateral server.
-            // Configure this LateralCacheManager instance to use the
-            // "zombie" services.
-
-            log.error( "Failure, lateral instance will use zombie service", ex );
-
-            this.lateralService = new ZombieLateralCacheService();
-            this.lateralWatch = new LateralCacheWatchRepairable();
-            this.lateralWatch.setCacheWatch( new ZombieLateralCacheWatch() );
-
-            // Notify the cache monitor about the error, and kick off
-            // the recovery process.
-            LateralCacheMonitor.getInstance().notifyError();
-        }
-    }
-
     /**
      * Adds the lateral cache listener to the underlying cache-watch service.
      * 
@@ -225,64 +100,8 @@
      * @return AuxiliaryCache
      * @param cacheName
      */
-    public AuxiliaryCache getCache( String cacheName )
-    {
-        LateralCacheNoWait c = null;
-        synchronized ( this.caches )
-        {
-            c = (LateralCacheNoWait) this.caches.get( cacheName );
-            if ( c == null )
-            {
-                LateralCacheAttributes attr = (LateralCacheAttributes) lca.copy();
-                attr.setCacheName( cacheName );
-                LateralCache cache = new LateralCache( attr, this.lateralService );
-                if ( log.isDebugEnabled() )
-                {
-                    log.debug( "Created cache for noWait, cache = [" + cache + "]" );
-                }
-                c = new LateralCacheNoWait( cache );
-                this.caches.put( cacheName, c );
-
-                log.info( "Created LateralCacheNoWait for " + this.lca + " LateralCacheNoWait = [" + c + "]" );
-            }
-        }
-
-        // don't create a listener if we are not receiving.
-        if ( lca.isReceive() )
-        {
-            try
-            {
-                if ( this.lca.getTransmissionType() == ILateralCacheAttributes.TCP )
-                {
-                    addLateralCacheListener( cacheName, LateralTCPListener.getInstance( this.lca, cacheMgr ) );
-                }
-                else if ( this.lca.getTransmissionType() == ILateralCacheAttributes.JAVAGROUPS )
-                {
-                    addLateralCacheListener( cacheName, LateralCacheJGListener.getInstance( this.lca, cacheMgr ) );
-                }
-            }
-            catch ( IOException ioe )
-            {
-                log.error( "Problem creating lateral listener", ioe );
-            }
-            catch ( Exception e )
-            {
-                log.error( "Problem creating lateral listener", e );
-            }
-        }
-        else
-        {
-            if ( log.isDebugEnabled() )
-            {
-                log.debug( "Not creating a listener since we are not receiving." );
-            }
-        }
-
-        // TODO: need listener repair
-
-        return c;
-    }
-
+    public abstract AuxiliaryCache getCache( String cacheName );
+    
     /**
      * Gets the cacheType attribute of the LateralCacheManager object
      * 
@@ -327,4 +146,12 @@
             }
         }
     }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheManager#getCaches()
+     */
+    public Map getCaches()
+    {
+        return caches;
+    }    
 }

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheMonitor.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheMonitor.java?rev=280252&r1=280251&r2=280252&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheMonitor.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheMonitor.java Sun Sep 11 21:27:25 2005
@@ -20,6 +20,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheManager;
 import org.apache.jcs.engine.CacheConstants;
 
 /**
@@ -36,8 +37,6 @@
 {
     private final static Log log = LogFactory.getLog( LateralCacheMonitor.class );
 
-    private static LateralCacheMonitor instance;
-
     private static long idlePeriod = 20 * 1000;
 
     // minimum 20 seconds.
@@ -51,6 +50,8 @@
 
     private static int mode = ERROR;
 
+    private ILateralCacheManager manager;
+    
     /**
      * Configures the idle period between repairs.
      * 
@@ -76,27 +77,15 @@
         LateralCacheMonitor.idlePeriod = idlePeriod;
     }
 
-    /** Constructor for the LateralCacheMonitor object */
-    private LateralCacheMonitor()
+    /** Constructor for the LateralCacheMonitor object
+     * <p>
+     * It's the clients responsibility to decide how many
+     * of these there will be.
+     *  
+     * @param manager*/
+    public LateralCacheMonitor( ILateralCacheManager manager )
     {
-        // nop
-    }
-
-    /**
-     * Returns the singleton instance;
-     * 
-     * @return The instance value
-     */
-    static LateralCacheMonitor getInstance()
-    {
-        synchronized ( LateralCacheMonitor.class )
-        {
-            if ( instance == null )
-            {
-                return instance = new LateralCacheMonitor();
-            }
-        }
-        return instance;
+        this.manager = manager;
     }
 
     /**
@@ -176,14 +165,14 @@
 
             // Monitor each LateralCacheManager instance one after the other.
             // Each LateralCacheManager corresponds to one lateral connection.
-            log.info( "LateralCacheManager.instances.size() = " + LateralCacheManager.instances.size() );
+            log.info( "LateralCacheManager.instances.size() = " + manager.getInstances().size() );
             //for
             int cnt = 0;
-            Iterator itr = LateralCacheManager.instances.values().iterator();
+            Iterator itr = manager.getInstances().values().iterator();
             while ( itr.hasNext() )
             {
                 cnt++;
-                LateralCacheManager mgr = (LateralCacheManager) itr.next();
+                ILateralCacheManager mgr = (ILateralCacheManager) itr.next();
                 try
                 {
                     // If any cache is in error, it strongly suggests all caches
@@ -191,10 +180,10 @@
                     // same LateralCacheManager instance are in error. So we fix
                     // them once and for all.
                     //for
-                    log.info( "\n " + cnt + "- mgr.lca.getTcpServer() = " + mgr.lca.getTcpServer() + " mgr = " + mgr );
-                    log.info( "\n " + cnt + "- mgr.caches.size() = " + mgr.caches.size() );
+                    //log.info( "\n " + cnt + "- mgr.lca.getTcpServer() = " + mgr.lca.getTcpServer() + " mgr = " + mgr );
+                    log.info( "\n " + cnt + "- mgr.getCaches().size() = " + mgr.getCaches().size() );
 
-                    if ( mgr.caches.size() == 0 )
+                    if ( mgr.getCaches().size() == 0 )
                     {
                         // there is probably a problem.
                         // monitor may be running when we just started up and
@@ -208,7 +197,7 @@
                         }
                     }
 
-                    Iterator itr2 = mgr.caches.values().iterator();
+                    Iterator itr2 = mgr.getCaches().values().iterator();
 
                     while ( itr2.hasNext() )
                     {

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheRestore.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheRestore.java?rev=280252&r1=280251&r2=280252&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheRestore.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheRestore.java Sun Sep 11 21:27:25 2005
@@ -16,17 +16,13 @@
  * limitations under the License.
  */
 
-import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheManager;
 import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheObserver;
 import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheService;
-
-import org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPService;
-
 import org.apache.jcs.engine.behavior.ICacheRestore;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 /**
  * Used to repair the lateral caches managed by the associated instance of
  * LateralCacheManager.
@@ -37,7 +33,7 @@
 {
     private final static Log log = LogFactory.getLog( LateralCacheRestore.class );
 
-    private final LateralCacheManager lcm;
+    private final ILateralCacheManager lcm;
 
     private boolean canFix = true;
 
@@ -48,7 +44,7 @@
      * 
      * @param lcm
      */
-    public LateralCacheRestore( LateralCacheManager lcm )
+    public LateralCacheRestore( ILateralCacheManager lcm )
     {
         this.lcm = lcm;
     }
@@ -68,10 +64,7 @@
 
         try
         {
-            if ( lcm.lca.getTransmissionType() == ILateralCacheAttributes.TCP )
-            {
-                lateralObj = new LateralTCPService( lcm.lca );
-            }
+            lateralObj = lcm.fixService();
         }
         catch ( Exception ex )
         {

Added: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheManager.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheManager.java?rev=280252&view=auto
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheManager.java (added)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheManager.java Sun Sep 11 21:27:25 2005
@@ -0,0 +1,51 @@
+package org.apache.jcs.auxiliary.lateral.behavior;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.apache.jcs.auxiliary.AuxiliaryCacheManager;
+
+/**
+ * This helps ensure some common behvior among LateraLCacheManagers
+ * for things such as montiors.
+ * 
+ * @author Aaron Smuts
+ *
+ */
+public interface ILateralCacheManager extends AuxiliaryCacheManager
+{
+
+    /**
+     * This is a temporary solution that allos the monitor to get the instances of a manager. 
+     * 
+     * @return
+     */
+    public abstract Map getInstances();
+    
+    
+    /**
+     * This is a temporary solution that allos the monitor to get caches from an instance of a manager. 
+     * 
+     * @return
+     */
+    public abstract Map getCaches();
+    
+    
+    /**
+     * The restore calls thsi on the manger if a cache if found to be in error.
+     * 
+     * @return Object is the service if it can be fixed.
+     * @throws IOException if the service cannot be fixed.
+     */
+    public abstract Object fixService() throws IOException;
+
+    /**
+     * Sets the corected service.  The restore process will call this
+     * if it gets a good service back from fixService.
+     * 
+     * @param lateralService
+     * @param lateralWatch
+     */
+    public void fixCaches( ILateralCacheService lateralService, ILateralCacheObserver lateralWatch );
+    
+}

Added: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java?rev=280252&view=auto
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java (added)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java Sun Sep 11 21:27:25 2005
@@ -0,0 +1,175 @@
+package org.apache.jcs.auxiliary.lateral.socket.tcp;
+
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jcs.auxiliary.AuxiliaryCache;
+import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
+import org.apache.jcs.auxiliary.lateral.LateralCacheAbstractFactory;
+import org.apache.jcs.auxiliary.lateral.LateralCacheAttributes;
+import org.apache.jcs.auxiliary.lateral.LateralCacheNoWait;
+import org.apache.jcs.auxiliary.lateral.LateralCacheNoWaitFacade;
+import org.apache.jcs.auxiliary.lateral.socket.tcp.discovery.UDPDiscoveryManager;
+import org.apache.jcs.auxiliary.lateral.socket.tcp.discovery.UDPDiscoveryService;
+import org.apache.jcs.engine.behavior.ICache;
+import org.apache.jcs.engine.behavior.ICompositeCacheManager;
+
+/**
+ * Constructs a LateralCacheNoWaitFacade for the given configuration. Each
+ * lateral service / local relationship is managed by one manager. This manager
+ * canl have multiple caches. The remote relationships are consolidated and
+ * restored via these managers. The facade provides a front to the composite
+ * cache so the implmenetation is transparent.
+ *  
+ */
+public class LateralTCPCacheFactory
+    extends LateralCacheAbstractFactory
+{
+    private final static Log log = LogFactory.getLog( LateralTCPCacheFactory.class );
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.jcs.auxiliary.AuxiliaryCacheFactory#createCache(org.apache.jcs.auxiliary.AuxiliaryCacheAttributes,
+     *      org.apache.jcs.engine.behavior.ICompositeCacheManager)
+     */
+    public AuxiliaryCache createCache( AuxiliaryCacheAttributes iaca, ICompositeCacheManager cacheMgr )
+    {
+
+        LateralCacheAttributes lac = (LateralCacheAttributes) iaca;
+        ArrayList noWaits = new ArrayList();
+
+        //pars up the tcp servers and set the tcpServer value and
+        // get the manager and then get the cache
+        // no servers are required.
+        if ( lac.getTcpServers() != null )
+        {
+            StringTokenizer it = new StringTokenizer( lac.getTcpServers(), "," );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "Configured for " + it.countTokens() + "  servers." );
+            }
+            while ( it.hasMoreElements() )
+            {
+                String server = (String) it.nextElement();
+                if ( log.isDebugEnabled() )
+                {
+                    log.debug( "tcp server = " + server );
+                }
+                LateralCacheAttributes lacC = (LateralCacheAttributes) lac.copy();
+                lacC.setTcpServer( server );
+                LateralTCPCacheManager lcm = LateralTCPCacheManager.getInstance( lacC, cacheMgr );
+                ICache ic = lcm.getCache( lacC.getCacheName() );
+                if ( ic != null )
+                {
+                    noWaits.add( ic );
+                }
+                else
+                {
+                    log.debug( "noWait is null, no lateral connection made" );
+                }
+            }
+        }
+
+        createListener( lac, cacheMgr );
+
+        // create the no wait facade.
+        LateralCacheNoWaitFacade lcnwf = new LateralCacheNoWaitFacade( (LateralCacheNoWait[]) noWaits
+            .toArray( new LateralCacheNoWait[0] ), iaca.getCacheName() );
+
+        // create udp discovery if available.
+        createDiscoveryService( lac, lcnwf, cacheMgr );
+
+        return lcnwf;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.jcs.auxiliary.lateral.LateralCacheAbstractFactory#createListener(org.apache.jcs.auxiliary.lateral.LateralCacheAttributes,
+     *      org.apache.jcs.engine.behavior.ICompositeCacheManager)
+     */
+    public void createListener( LateralCacheAttributes lac, ICompositeCacheManager cacheMgr )
+    {
+        // don't create a listener if we are not receiving.
+        if ( lac.isReceive() )
+        {
+
+            if ( log.isInfoEnabled() )
+            {
+                log.info( "Creating listener for " + lac );
+            }
+
+            try
+            {
+
+                // make a listener. if one doesn't exist
+                LateralTCPListener.getInstance( lac, cacheMgr );
+
+            }
+            catch ( Exception e )
+            {
+                log.error( "Problem creating lateral listener", e );
+            }
+        }
+        else
+        {
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "Not creating a listener since we are not receiving." );
+            }
+        }
+    }
+
+    /**
+     * Creates the discovery service. Only creates this for tcp laterals right
+     * now.
+     * 
+     * @param lac
+     * @param lcnwf
+     * @param cacheMgr
+     * @return null if none is created.
+     */
+    private UDPDiscoveryService createDiscoveryService( LateralCacheAttributes lac, LateralCacheNoWaitFacade lcnwf,
+                                                       ICompositeCacheManager cacheMgr )
+    {
+        UDPDiscoveryService discovery = null;
+
+        //      create the UDP discovery for the TCP lateral
+        if ( lac.isUdpDiscoveryEnabled() )
+        {
+
+            // need a factory for this so it doesn't
+            // get dereferenced, also we don't want one for every region.
+            discovery = UDPDiscoveryManager.getInstance().getService( lac, cacheMgr );
+
+            discovery.addNoWaitFacade( lcnwf, lac.getCacheName() );
+
+            if ( log.isInfoEnabled() )
+            {
+                log.info( "Created UDPDiscoveryService for TCP lateral cache." );
+            }
+
+        }
+        return discovery;
+    }
+
+}

Added: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheManager.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheManager.java?rev=280252&view=auto
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheManager.java (added)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPCacheManager.java Sun Sep 11 21:27:25 2005
@@ -0,0 +1,315 @@
+package org.apache.jcs.auxiliary.lateral.socket.tcp;
+
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jcs.auxiliary.AuxiliaryCache;
+import org.apache.jcs.auxiliary.lateral.LateralCache;
+import org.apache.jcs.auxiliary.lateral.LateralCacheAbstractManager;
+import org.apache.jcs.auxiliary.lateral.LateralCacheAttributes;
+import org.apache.jcs.auxiliary.lateral.LateralCacheMonitor;
+import org.apache.jcs.auxiliary.lateral.LateralCacheNoWait;
+import org.apache.jcs.auxiliary.lateral.LateralCacheWatchRepairable;
+import org.apache.jcs.auxiliary.lateral.ZombieLateralCacheService;
+import org.apache.jcs.auxiliary.lateral.ZombieLateralCacheWatch;
+import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
+import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheListener;
+import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheManager;
+import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheService;
+import org.apache.jcs.engine.behavior.ICompositeCacheManager;
+
+/**
+ * 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.
+ * <p>
+ * 
+ * @TODO: - need freeCache, release, getStats - need to find an interface
+ *        acceptible for all - cache managers or a manager within a type
+ */
+public class LateralTCPCacheManager
+    extends LateralCacheAbstractManager
+{
+    private final static Log log = LogFactory.getLog( LateralTCPCacheManager.class );
+
+    private static LateralCacheMonitor monitor;
+
+    protected static Map instances = new HashMap();
+
+    /**
+     * Description of the Field
+     */
+    protected ILateralCacheAttributes lca;
+
+    private int clients;
+
+    /**
+     * Handle to the lateral cache service; or a zombie handle if failed to
+     * connect.
+     */
+    private ILateralCacheService lateralService;
+
+    /**
+     * Wrapper of the lateral cache watch service; or wrapper of a zombie
+     * service if failed to connect.
+     */
+    private LateralCacheWatchRepairable lateralWatch;
+
+    private ICompositeCacheManager cacheMgr;
+
+    /**
+     * Returns an instance of the LateralCacheManager.
+     * 
+     * @param lca
+     * @param cacheMgr
+     *            this allows the auxiliary to be passed a cache manager.
+     * @return
+     */
+    public static LateralTCPCacheManager getInstance( ILateralCacheAttributes lca, ICompositeCacheManager cacheMgr )
+    {
+        LateralTCPCacheManager ins = (LateralTCPCacheManager) instances.get( lca.toString() );
+        synchronized ( instances )
+        {
+            if ( ins == null )
+            {
+                log.info( "Instance for [" + lca.toString() + "] is null, creating" );
+
+                ins = (LateralTCPCacheManager) instances.get( lca.toString() );
+                if ( ins == null )
+                {
+                    ins = new LateralTCPCacheManager( lca, cacheMgr );
+                    instances.put( lca.toString(), ins );
+                }
+            }
+
+            createMonitor( ins );
+
+        }
+
+        ins.clients++;
+
+        return ins;
+    }
+
+    /**
+     * The monitor needs reference to one instance, acutally just a type.
+     * 
+     * refactor this.
+     * 
+     * @param instance
+     */
+    private static synchronized void createMonitor( ILateralCacheManager instance )
+    {
+        //      only want one monitor per lateral type
+        // Fires up the monitoring daemon.
+        if ( monitor == null )
+        {
+            monitor = new LateralCacheMonitor( instance );
+            // Should never be null
+            if ( monitor != null )
+            {
+                Thread t = new Thread( monitor );
+                t.setDaemon( true );
+                t.start();
+            }
+        }
+
+    }
+
+    /**
+     * Constructor for the LateralCacheManager object
+     * 
+     * @param lcaA
+     * @param cacheMgr
+     */
+    private LateralTCPCacheManager( ILateralCacheAttributes lcaA, ICompositeCacheManager cacheMgr )
+    {
+        this.lca = lcaA;
+
+        this.cacheMgr = cacheMgr;
+
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "Creating lateral cache service, lca = " + this.lca );
+        }
+
+        // need to create the service based on the type
+
+        try
+        {
+
+            log.debug( "Creating TCP service" );
+            log.info( "Creating TCP service, lca = " + this.lca );
+
+            this.lateralService = new LateralTCPService( this.lca );
+
+            if ( this.lateralService == null )
+            {
+                log.error( "No service created, must zombie" );
+
+                throw new Exception( "No service created for lateral cache." );
+            }
+
+            this.lateralWatch = new LateralCacheWatchRepairable();
+            this.lateralWatch.setCacheWatch( new ZombieLateralCacheWatch() );
+
+        }
+        catch ( Exception ex )
+        {
+            // Failed to connect to the lateral server.
+            // Configure this LateralCacheManager instance to use the
+            // "zombie" services.
+
+            log.error( "Failure, lateral instance will use zombie service", ex );
+
+            this.lateralService = new ZombieLateralCacheService();
+            this.lateralWatch = new LateralCacheWatchRepairable();
+            this.lateralWatch.setCacheWatch( new ZombieLateralCacheWatch() );
+
+            // Notify the cache monitor about the error, and kick off
+            // the recovery process.
+            createMonitor( this );
+            monitor.notifyError();
+        }
+    }
+
+    /**
+     * 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
+     */
+    public void addLateralCacheListener( String cacheName, ILateralCacheListener listener )
+        throws IOException
+    {
+        synchronized ( this.caches )
+        {
+            this.lateralWatch.addCacheListener( cacheName, listener );
+        }
+    }
+
+    /**
+     * 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.
+     * <p>
+     * After getting the manager instance for a server, the factory gets a cache
+     * for the region name it is constructing.
+     * <p>
+     * There should be one manager per server and one cache per region per
+     * manager.
+     * 
+     * @return AuxiliaryCache
+     * @param cacheName
+     */
+    public AuxiliaryCache getCache( String cacheName )
+    {
+        LateralCacheNoWait c = null;
+        synchronized ( this.caches )
+        {
+            c = (LateralCacheNoWait) this.caches.get( cacheName );
+            if ( c == null )
+            {
+                LateralCacheAttributes attr = (LateralCacheAttributes) lca.copy();
+                attr.setCacheName( cacheName );
+                LateralCache cache = new LateralCache( attr, this.lateralService, monitor );
+                if ( log.isDebugEnabled() )
+                {
+                    log.debug( "Created cache for noWait, cache = [" + cache + "]" );
+                }
+                c = new LateralCacheNoWait( cache );
+                this.caches.put( cacheName, c );
+
+                log.info( "Created LateralCacheNoWait for " + this.lca + " LateralCacheNoWait = [" + c + "]" );
+            }
+        }
+
+        // don't create a listener if we are not receiving.
+        if ( lca.isReceive() )
+        {
+            try
+            {
+
+                addLateralCacheListener( cacheName, LateralTCPListener.getInstance( this.lca, cacheMgr ) );
+
+            }
+            catch ( IOException ioe )
+            {
+                log.error( "Problem creating lateral listener", ioe );
+            }
+            catch ( Exception e )
+            {
+                log.error( "Problem creating lateral listener", e );
+            }
+        }
+        else
+        {
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "Not creating a listener since we are not receiving." );
+            }
+        }
+
+        // TODO: need listener repair
+
+        return c;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.jcs.auxiliary.lateral.LateralCacheAbstractManager#getInstances()
+     */
+    public Map getInstances()
+    {
+        return instances;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheManager#fixService()
+     */
+    public Object fixService()
+        throws IOException
+    {
+        Object service = null;
+        try
+        {
+            service = new LateralTCPService( lca );
+        }
+        catch ( Exception ex )
+        {
+            log.error( "Can't fix " + ex.getMessage() );
+            throw new IOException( "Can't fix " + ex.getMessage() );
+        }
+        return service;
+    }
+
+}

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java?rev=280252&r1=280251&r2=280252&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java Sun Sep 11 21:27:25 2005
@@ -105,7 +105,13 @@
         }
     }
 
-    /** Description of the Method */
+    /**
+     * Creates a connection to a TCP server.
+     * 
+     * @param host
+     * @param port
+     * @throws IOException 
+     */
     protected void init( String host, int port )
         throws IOException
     {
@@ -122,7 +128,7 @@
 
             if ( socket == null )
             {
-                throw new IOException( "Socket is null" );
+                throw new IOException( "Socket is null, cannot connect to " + host + ":" + port  );
             }
 
             socket.setSoTimeout( LateralTCPSender.timeOut );

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/discovery/UDPDiscoveryReceiver.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/discovery/UDPDiscoveryReceiver.java?rev=280252&r1=280251&r2=280252&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/discovery/UDPDiscoveryReceiver.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/discovery/UDPDiscoveryReceiver.java Sun Sep 11 21:27:25 2005
@@ -29,8 +29,8 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.jcs.auxiliary.lateral.LateralCacheAttributes;
 import org.apache.jcs.auxiliary.lateral.LateralCacheInfo;
-import org.apache.jcs.auxiliary.lateral.LateralCacheManager;
 import org.apache.jcs.auxiliary.lateral.LateralCacheNoWait;
+import org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheManager;
 import org.apache.jcs.engine.behavior.ICache;
 import org.apache.jcs.engine.behavior.ICompositeCacheManager;
 import org.apache.jcs.engine.behavior.ShutdownObserver;
@@ -60,7 +60,7 @@
 
     // number of messages received.
     private int cnt = 0;
-       
+
     /**
      * Service to get cache names and hande request broadcasts
      */
@@ -70,10 +70,10 @@
 
     private int multicastPort = 0;
 
-    private ICompositeCacheManager cacheMgr; 
-    
+    private ICompositeCacheManager cacheMgr;
+
     private boolean shutdown = false;
-    
+
     /**
      * Constructor for the LateralUDPReceiver object.
      * <p>
@@ -93,7 +93,7 @@
         this.multicastAddressString = multicastAddressString;
         this.multicastPort = multicastPort;
         this.cacheMgr = cacheMgr;
-        
+
         // create a small thread pool to handle a barage
         pooledExecutor = new PooledExecutor( new BoundedBuffer( 100 ), maxPoolSize );
         pooledExecutor.discardOldestWhenBlocked();
@@ -218,8 +218,8 @@
         catch ( Exception e )
         {
             log.error( "Unexpected exception in UDP receiver.", e );
-            try 
-            {                
+            try
+            {
                 Thread.sleep( 100 );
                 // TODO consider some failure count so we don't do this
                 // forever.
@@ -318,7 +318,7 @@
                     }
                     lca.setTransmissionType( LateralCacheAttributes.TCP );
                     lca.setTcpServer( message.getHost() + ":" + message.getPort() );
-                    LateralCacheManager lcm = LateralCacheManager.getInstance( lca, cacheMgr );
+                    LateralTCPCacheManager lcm = LateralTCPCacheManager.getInstance( lca, cacheMgr );
 
                     ArrayList regions = message.getCacheNames();
                     if ( regions != null )
@@ -394,15 +394,17 @@
 
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.apache.jcs.engine.behavior.ShutdownObserver#shutdown()
      */
     public void shutdown()
     {
-        try 
+        try
         {
             shutdown = true;
-            m_socket.close();      
+            m_socket.close();
             pooledExecutor.shutdownNow();
         }
         catch ( Exception e )



---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org