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/08/22 02:12:34 UTC

svn commit: r234393 - in /jakarta/jcs/trunk: ./ auxiliary-builds/jdk14/ auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/disk/bdbje/ auxiliary-builds/jdk14/src/test-conf/ auxiliary-builds/jdk14/src/test/org/apache/jcs/ src/conf/ src/java/org/ap...

Author: asmuts
Date: Sun Aug 21 17:12:06 2005
New Revision: 234393

URL: http://svn.apache.org/viewcvs?rev=234393&view=rev
Log:
Properties are loaded using the current thread's classloader by default.
When a config file is not found a descriptive error message is printed to the logs.
Made an interface for the cache manager to improve testability.
Auxiliaries are assigned a cache manager and the lateral TCP has a settable source id, so it can be tested.
Increased JGroups version to 2.2.8.  It works again.  The old JGroups didn't work for unknown reasons.
Cleaned up some javadocs.
Improved info level logging for TCP lateral.
Added configuration properties xdocs for TCP lateral, indexed disk, and memory cache.
Created concurrent tests for TCP lateral to verify correct region behavior.
Made BDBJE work with new auxiliary changes.
UDP discovery no longer activates if the lateral type isn't TCP.
Reduced lateral get timeout to 1 second, rather than 10.  We still need to disable gets when a timeout occurs.



Modified:
    jakarta/jcs/trunk/auxiliary-builds/jdk14/project.properties
    jakarta/jcs/trunk/auxiliary-builds/jdk14/project.xml
    jakarta/jcs/trunk/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/disk/bdbje/BDBJECacheFactory.java
    jakarta/jcs/trunk/auxiliary-builds/jdk14/src/test-conf/TestBDBJEDiskCacheCon.ccf
    jakarta/jcs/trunk/auxiliary-builds/jdk14/src/test/org/apache/jcs/TestBDBJEDiskCacheConcurrent.java
    jakarta/jcs/trunk/project.xml
    jakarta/jcs/trunk/src/conf/cache.ccf
    jakarta/jcs/trunk/src/conf/cacheJG1.ccf
    jakarta/jcs/trunk/src/conf/cacheJG2.ccf
    jakarta/jcs/trunk/src/conf/cacheTCP2.ccf
    jakarta/jcs/trunk/src/conf/log4j.properties
    jakarta/jcs/trunk/src/java/org/apache/jcs/access/CacheAccess.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/access/GroupCacheAccess.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/access/monitor/MonitorAccess.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/admin/CacheRegionInfo.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/AuxiliaryCacheFactory.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCacheFactory.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java
    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/behavior/ILateralCacheListener.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/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/utils/JGRpcOpener.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/utils/JGSocketOpener.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.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/LateralTCPService.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerListener.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCache.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheConfigurator.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractMemoryCache.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/behavior/IMemoryCache.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java
    jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/mru/MRUMemoryCache.java
    jakarta/jcs/trunk/src/test-conf/TestTCPLateralCache.ccf
    jakarta/jcs/trunk/src/test-conf/log4j.properties
    jakarta/jcs/trunk/src/test/org/apache/jcs/TestDiskCacheConcurrentRandom.java
    jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateral.java
    jakarta/jcs/trunk/src/test/org/apache/jcs/engine/memory/lru/TestLRUMemoryCache.java
    jakarta/jcs/trunk/xdocs/LateralTCPAuxCache.xml
    jakarta/jcs/trunk/xdocs/navigation.xml

Modified: jakarta/jcs/trunk/auxiliary-builds/jdk14/project.properties
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/auxiliary-builds/jdk14/project.properties?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/auxiliary-builds/jdk14/project.properties (original)
+++ jakarta/jcs/trunk/auxiliary-builds/jdk14/project.properties Sun Aug 21 17:12:06 2005
@@ -1,3 +1,3 @@
 maven.jar.override = on
 maven.junit.fork = true
-maven.jar.jcs = ${basedir}/../../target/jcs-1.1.3-dev.jar
+#maven.jar.jcs = ${basedir}/../../target/jcs-1.1.3-dev.jar

Modified: jakarta/jcs/trunk/auxiliary-builds/jdk14/project.xml
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/auxiliary-builds/jdk14/project.xml?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/auxiliary-builds/jdk14/project.xml (original)
+++ jakarta/jcs/trunk/auxiliary-builds/jdk14/project.xml Sun Aug 21 17:12:06 2005
@@ -4,7 +4,7 @@
   <extend>../../project-b4.xml</extend>  
   <id>jcs</id>
   <name>jdk14-ext</name>
-  <currentVersion>1.1-dev-jdk14-ext</currentVersion>
+  <currentVersion>jdk14-ext-1.2.6.6</currentVersion>
  
 
   <dependencies>
@@ -41,8 +41,9 @@
       <version>2.2</version>
     </dependency>
     <dependency>
-      <id>javagroups</id>
-      <jar>jgroups-all-2.2.jar</jar>
+      <groupId>jgroups</groupId>
+      <artifactId>jgroups-all</artifactId>
+      <version>2.2.8</version>
     </dependency>
     <dependency>
       <id>jisp</id>
@@ -83,12 +84,13 @@
     </dependency>
     <dependency>
       <id>berkeleydb</id>
-      <version>1.5.0</version>
+      <version>1.5.1</version>
     </dependency>
 
     <dependency>
 	<groupId>jcs</groupId>
 	<artifactId>jcs</artifactId>
+      <version>1.2.6.6</version>
     </dependency>
 
   </dependencies>

Modified: jakarta/jcs/trunk/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/disk/bdbje/BDBJECacheFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/disk/bdbje/BDBJECacheFactory.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/disk/bdbje/BDBJECacheFactory.java (original)
+++ jakarta/jcs/trunk/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/disk/bdbje/BDBJECacheFactory.java Sun Aug 21 17:12:06 2005
@@ -22,6 +22,7 @@
 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;
 import org.apache.jcs.engine.control.CompositeCache;
 
 /**
@@ -41,7 +42,7 @@
    */
   public AuxiliaryCache createCache(
       AuxiliaryCacheAttributes attr,
-      CompositeCache cache )
+      ICompositeCacheManager cacheMgr )
   {
     BDBJECacheAttributes jeattr = ( BDBJECacheAttributes ) attr;
     BDBJECacheManager jecm = BDBJECacheManager.getInstance( jeattr );

Modified: jakarta/jcs/trunk/auxiliary-builds/jdk14/src/test-conf/TestBDBJEDiskCacheCon.ccf
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/auxiliary-builds/jdk14/src/test-conf/TestBDBJEDiskCacheCon.ccf?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/auxiliary-builds/jdk14/src/test-conf/TestBDBJEDiskCacheCon.ccf (original)
+++ jakarta/jcs/trunk/auxiliary-builds/jdk14/src/test-conf/TestBDBJEDiskCacheCon.ccf Sun Aug 21 17:12:06 2005
@@ -1,36 +1,29 @@
 # Cache configuration for the 'TestDiskCache' test. The memory cache has a
 # a maximum of 100 objects, so objects should get pushed into the disk cache
 
-jcs.default=indexedDiskCache
+jcs.default=bdbje
 jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
 jcs.default.cacheattributes.MaxObjects=100
 jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
 
-# SYSTEM GROUP ID CACHE
-jcs.system.groupIdCache=indexedDiskCache
-jcs.system.groupIdCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
-jcs.system.groupIdCache.cacheattributes.MaxObjects=10000
-jcs.system.groupIdCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
-
-
 ##### CACHE REGIONS FOR TEST
 
-jcs.region.indexedRegion1=indexedDiskCache
+jcs.region.indexedRegion1=bdbje
 jcs.region.indexedRegion1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
 jcs.region.indexedRegion1.cacheattributes.MaxObjects=100
 jcs.region.indexedRegion1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
 
-jcs.region.indexedRegion2=indexedDiskCache
+jcs.region.indexedRegion2=bdbje
 jcs.region.indexedRegion2.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
 jcs.region.indexedRegion2.cacheattributes.MaxObjects=100
 jcs.region.indexedRegion2.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
 
-jcs.region.indexedRegion3=indexedDiskCache
+jcs.region.indexedRegion3=bdbje
 jcs.region.indexedRegion3.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
 jcs.region.indexedRegion3.cacheattributes.MaxObjects=100
 jcs.region.indexedRegion3.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
 
-jcs.region.indexedRegion4=indexedDiskCache
+jcs.region.indexedRegion4=bdbje
 jcs.region.indexedRegion4.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
 jcs.region.indexedRegion4.cacheattributes.MaxObjects=100
 jcs.region.indexedRegion4.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
@@ -40,6 +33,7 @@
 ##### AUXILIARY CACHES
 
 # Berkeley DB JE
-jcs.auxiliary.indexedDiskCache=org.apache.jcs.auxiliary.disk.bdbje.BDBJECacheFactory
-jcs.auxiliary.indexedDiskCache.attributes=org.apache.jcs.auxiliary.disk.bdbje.BDBJECacheAttributes
-jcs.auxiliary.indexedDiskCache.attributes.DiskPath=target/test-sandbox/bdbje-disk-cache-conc
+jcs.auxiliary.bdbje=org.apache.jcs.auxiliary.disk.bdbje.BDBJECacheFactory
+jcs.auxiliary.bdbje.attributes=org.apache.jcs.auxiliary.disk.bdbje.BDBJECacheAttributes
+jcs.auxiliary.bdbje.attributes.DiskPath=target/test-sandbox/bdbje-disk-cache-conc
+jcs.auxiliary.bdbje.attributes.MaxPurgatorySize=100000
\ No newline at end of file

Modified: jakarta/jcs/trunk/auxiliary-builds/jdk14/src/test/org/apache/jcs/TestBDBJEDiskCacheConcurrent.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/auxiliary-builds/jdk14/src/test/org/apache/jcs/TestBDBJEDiskCacheConcurrent.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/auxiliary-builds/jdk14/src/test/org/apache/jcs/TestBDBJEDiskCacheConcurrent.java (original)
+++ jakarta/jcs/trunk/auxiliary-builds/jdk14/src/test/org/apache/jcs/TestBDBJEDiskCacheConcurrent.java Sun Aug 21 17:12:06 2005
@@ -54,37 +54,38 @@
   public static Test suite() {
     ActiveTestSuite suite = new ActiveTestSuite();
 
-    suite.addTest(new TestBDBJE("testIndexedDiskCache1") {
+    suite.addTest(new TestBDBJE("testBDBJECache1") {
       public void runTest() throws Exception {
         runTestForRegion("indexedRegion4", 0, 200);
       }
     });
 
-    suite.addTest(new TestBDBJE("testIndexedDiskCache2") {
+    suite.addTest(new TestBDBJE("testBDBJECache2") {
       public void runTest() throws Exception {
         runTestForRegion("indexedRegion4", 1000, 1200);
       }
     });
 
-    suite.addTest(new TestBDBJE("testIndexedDiskCache3") {
+    suite.addTest(new TestBDBJE("testBDBJECache3") {
       public void runTest() throws Exception {
         runTestForRegion("indexedRegion4", 2000, 3200);
       }
     });
 
-    suite.addTest(new TestBDBJE("testIndexedDiskCache4") {
+    suite.addTest(new TestBDBJE("testBDBJECache4") {
       public void runTest() throws Exception {
         runTestForRegion("indexedRegion4", 2200, 5200);
       }
     });
 
-    suite.addTest(new TestBDBJE("testIndexedDiskCache5") {
+    /*
+    suite.addTest(new TestBDBJE("testBDBJECache5") {
       public void runTest() throws Exception {
         runTestForRegion("indexedRegion4", 0, 10000);
       }
     });
 
-    suite.addTest(new TestBDBJE("testIndexedDiskCache5") {
+    suite.addTest(new TestBDBJE("testBDBJECache6") {
       public void runTest() throws Exception {
         runTestForRegion("indexedRegion3", 0, 5000);
       }
@@ -101,7 +102,7 @@
         runTestForRegion("indexedRegion1", 0, 5000);
       }
     });
-
+*/
     return suite;
   }
 
@@ -118,7 +119,7 @@
   public void tearDown() {
     try {
       CompositeCacheManager cacheMgr = CompositeCacheManager.getInstance();
-      cacheMgr.shutDown();
+      //cacheMgr.shutDown();
       /*
       String[] names = cacheMgr.getCacheNames();
       StringBuffer buf = new StringBuffer();

Modified: jakarta/jcs/trunk/project.xml
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/project.xml?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/project.xml (original)
+++ jakarta/jcs/trunk/project.xml Sun Aug 21 17:12:06 2005
@@ -5,7 +5,7 @@
   <pomVersion>3</pomVersion>
   <name>JCS</name>
   <id>jcs</id>
-  <currentVersion>1.2.6.5</currentVersion>
+  <currentVersion>1.2.6.6</currentVersion>
   <organization>
     <name>Apache Software Foundation</name>
     <url>http://jakarta.apache.org/</url>
@@ -128,8 +128,9 @@
       <version>2.2</version>
     </dependency>
     <dependency>
-      <id>jgroups</id>
-      <version>2.2.5</version>
+      <groupId>jgroups</groupId>
+      <artifactId>jgroups-all</artifactId>
+      <version>2.2.8</version>
     </dependency>
     <dependency>
       <id>jisp</id>
@@ -190,8 +191,9 @@
         <include>**/TestDiskCacheConcurrent.java</include>
         <include>**/TestDiskCacheConcurrentForDeadLock.java</include>
         <include>**/TestTCPLateralCache.java</include>
+        <include>**/TestLateralTCPConcurrentForDeadLock</include>
         <!--
-	<include>**/TestJCSvHashtablePerf.java</include>
+		<include>**/TestJCSvHashtablePerf.java</include>
 		-->
         <include>**/TestEventQueueConcurrent.java</include>
         <include>**/TestSimpleEventHandling.java</include>

Modified: jakarta/jcs/trunk/src/conf/cache.ccf
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/conf/cache.ccf?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/conf/cache.ccf (original)
+++ jakarta/jcs/trunk/src/conf/cache.ccf Sun Aug 21 17:12:06 2005
@@ -214,6 +214,7 @@
 
 # Disk Cache pool
 thread_pool.disk_cache_event_queue.useBoundary=false
+thread_pool.remote_cache_client.maximumPoolSize=15
 thread_pool.disk_cache_event_queue.minimumPoolSize=1
 thread_pool.disk_cache_event_queue.keepAliveTime=3500
 thread_pool.disk_cache_event_queue.startUpSize=1

Modified: jakarta/jcs/trunk/src/conf/cacheJG1.ccf
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/conf/cacheJG1.ccf?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
Binary files - no diff available.

Modified: jakarta/jcs/trunk/src/conf/cacheJG2.ccf
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/conf/cacheJG2.ccf?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
Binary files - no diff available.

Modified: jakarta/jcs/trunk/src/conf/cacheTCP2.ccf
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/conf/cacheTCP2.ccf?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
Binary files - no diff available.

Modified: jakarta/jcs/trunk/src/conf/log4j.properties
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/conf/log4j.properties?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/conf/log4j.properties (original)
+++ jakarta/jcs/trunk/src/conf/log4j.properties Sun Aug 21 17:12:06 2005
@@ -21,7 +21,7 @@
 
 #################################################################################
 
-log4j.category.org.jgroups=DEBUG
+log4j.category.org.jgroups=WARN
 
 log4j.category.org.apache.jcs=INFO
 log4j.category.org.apache.jcs.engine=INFO

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/access/CacheAccess.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/access/CacheAccess.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/access/CacheAccess.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/access/CacheAccess.java Sun Aug 21 17:12:06 2005
@@ -19,26 +19,21 @@
 import java.io.IOException;
 import java.io.Serializable;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.jcs.access.behavior.ICacheAccess;
-
 import org.apache.jcs.access.exception.CacheException;
 import org.apache.jcs.access.exception.InvalidHandleException;
 import org.apache.jcs.access.exception.ObjectExistsException;
-
-import org.apache.jcs.engine.behavior.IElementAttributes;
-import org.apache.jcs.engine.CompositeCacheAttributes;
 import org.apache.jcs.engine.CacheElement;
-
-import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
+import org.apache.jcs.engine.CompositeCacheAttributes;
 import org.apache.jcs.engine.behavior.ICacheElement;
-
+import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
+import org.apache.jcs.engine.behavior.IElementAttributes;
 import org.apache.jcs.engine.control.CompositeCache;
 import org.apache.jcs.engine.control.CompositeCacheManager;
 import org.apache.jcs.engine.stats.behavior.ICacheStats;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 /**
  * This class provides an interface for all types of access to the cache.
  * <p>
@@ -387,17 +382,6 @@
         this.cacheControl.remove( (Serializable) name );
     }
 
-    /**
-     * If there are any auxiliary caches associated with this cache, save all
-     * objects to them.
-     * <p>
-     * This is mainly a testing method. Dispose should do what you want on
-     * shutdown in a safer manner.
-     */
-    public void save()
-    {
-        this.cacheControl.save();
-    }
 
     /**
      * ResetAttributes allows for some of the attributes of a region to be reset
@@ -455,7 +439,7 @@
     public IElementAttributes getElementAttributes()
         throws CacheException
     {
-        return this.cacheControl.attr;
+        return this.cacheControl.getElementAttributes();
     }
 
     /**

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/access/GroupCacheAccess.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/access/GroupCacheAccess.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/access/GroupCacheAccess.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/access/GroupCacheAccess.java Sun Aug 21 17:12:06 2005
@@ -20,9 +20,9 @@
 
 import org.apache.jcs.access.behavior.IGroupCacheAccess;
 import org.apache.jcs.access.exception.CacheException;
+import org.apache.jcs.engine.behavior.ICacheElement;
 import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
 import org.apache.jcs.engine.behavior.IElementAttributes;
-import org.apache.jcs.engine.behavior.ICacheElement;
 import org.apache.jcs.engine.control.CompositeCache;
 import org.apache.jcs.engine.control.CompositeCacheManager;
 import org.apache.jcs.engine.control.group.GroupAttrName;

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/access/monitor/MonitorAccess.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/access/monitor/MonitorAccess.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/access/monitor/MonitorAccess.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/access/monitor/MonitorAccess.java Sun Aug 21 17:12:06 2005
@@ -68,7 +68,7 @@
 
         try
         {
-
+ 
             ICache cache = this.cacheMgr.getCache( cacheName );
 
             if ( key != null )

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/admin/CacheRegionInfo.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/admin/CacheRegionInfo.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/admin/CacheRegionInfo.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/admin/CacheRegionInfo.java Sun Aug 21 17:12:06 2005
@@ -16,8 +16,8 @@
  * limitations under the License.
  */
 
-import org.apache.jcs.engine.control.CompositeCache;
 import org.apache.jcs.engine.CacheConstants;
+import org.apache.jcs.engine.control.CompositeCache;
 
 /** Stores info on a cache region for the template */
 public class CacheRegionInfo

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/AuxiliaryCacheFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/AuxiliaryCacheFactory.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/AuxiliaryCacheFactory.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/AuxiliaryCacheFactory.java Sun Aug 21 17:12:06 2005
@@ -16,8 +16,8 @@
  * limitations under the License.
  */
 
-import org.apache.jcs.engine.behavior.ICompositeCache;
 import org.apache.jcs.engine.behavior.ICompositeCacheManager;
+import org.apache.jcs.engine.control.CompositeCache;
 
 /**
  * All auxiliary caches must have a factory that the cache configurator can

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCache.java Sun Aug 21 17:12:06 2005
@@ -16,6 +16,12 @@
  * limitations under the License.
  */
 
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Set;
+import java.util.Vector;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jcs.auxiliary.AuxiliaryCache;
@@ -23,30 +29,21 @@
 import org.apache.jcs.engine.CacheElement;
 import org.apache.jcs.engine.behavior.ICacheElement;
 import org.apache.jcs.engine.behavior.ICacheType;
-import org.apache.jcs.engine.behavior.ICompositeCache;
 import org.apache.jcs.engine.behavior.ICompositeCacheManager;
 import org.apache.jcs.engine.control.CompositeCache;
 import org.apache.jcs.engine.stats.StatElement;
 import org.apache.jcs.engine.stats.Stats;
 import org.apache.jcs.engine.stats.behavior.IStatElement;
 import org.apache.jcs.engine.stats.behavior.IStats;
+import org.jgroups.Address;
 import org.jgroups.Channel;
+import org.jgroups.MembershipListener;
 import org.jgroups.Message;
 import org.jgroups.View;
-import org.jgroups.Address;
-import org.jgroups.MembershipListener;
-import org.jgroups.util.RspList;
-import org.jgroups.blocks.RequestHandler;
 import org.jgroups.blocks.GroupRequest;
 import org.jgroups.blocks.MessageDispatcher;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-import java.util.Vector;
+import org.jgroups.blocks.RequestHandler;
+import org.jgroups.util.RspList;
 
 /**
  * Auxiliary cache using javagroups. Expects to be created with a Channel, the
@@ -355,15 +352,16 @@
     }
 
     /**
-     * TODO speed this up. We don't want to ahve to go through the manager everytime.
+     * TODO speed this up. We don't want to ahve to go through the manager
+     * everytime.
      * 
      * @return ICompositeCache
      */
-    private ICompositeCache getCompositeCache()
+    private CompositeCache getCompositeCache()
     {
         return cacheMgr.getCache( this.cacheName );
     }
-    
+
     // ------------------------------------------- interface MembershipListener
 
     public void viewAccepted( View view )

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCacheFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCacheFactory.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCacheFactory.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/javagroups/JavaGroupsCacheFactory.java Sun Aug 21 17:12:06 2005
@@ -22,7 +22,6 @@
 import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
 import org.apache.jcs.auxiliary.AuxiliaryCacheFactory;
 import org.apache.jcs.engine.behavior.ICompositeCacheManager;
-import org.apache.jcs.engine.control.CompositeCache;
 import org.jgroups.Channel;
 import org.jgroups.ChannelFactory;
 

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=234393&r1=234392&r2=234393&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 Aug 21 17:12:06 2005
@@ -94,7 +94,8 @@
         }
         catch ( NullPointerException npe )
         {
-            log.error( "Failure updating lateral", npe );
+            log.error( "Failure updating lateral. lateral = " + lateral, npe );
+            handleException( npe, "Failed to put " + ce.getKey() + " to " + ce.getCacheName() );
             return;
         }
         catch ( Exception ex )
@@ -296,7 +297,14 @@
      */
     public void fixCache( ILateralCacheService lateral )
     {
-        this.lateral = lateral;
+        if ( lateral != null )
+        {
+            this.lateral = lateral;            
+        }
+        else
+        {
+            log.warn( "Fix cache called with null lateral." );
+        }
         return;
     }
 

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheFactory.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheFactory.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheFactory.java Sun Aug 21 17:12:06 2005
@@ -177,6 +177,12 @@
         // don't create a listener if we are not receiving.
         if ( lac.isReceive() )
         {
+     
+            if ( log.isInfoEnabled() )
+            {
+                log.info( "Creating listener for " + lac );
+            }
+            
             try
             {
                 if ( lac.getTransmissionType() == ILateralCacheAttributes.TCP )
@@ -186,7 +192,7 @@
                 }
                 else if ( lac.getTransmissionType() == ILateralCacheAttributes.JAVAGROUPS )
                 {
-                    LateralCacheJGListener.getInstance( lac );
+                    LateralCacheJGListener.getInstance( lac, cacheMgr );
                 }
 
             }
@@ -225,16 +231,18 @@
                 log
                     .warn( "UdpDiscoveryEnabled is set to true, but the Lateral cache type is not TCP.  Discovery will not be enabled." );
             }
+            else
+            {
+                // 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 );
 
-            // 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() );
+                discovery.addNoWaitFacade( lcnwf, lac.getCacheName() );
 
-            if ( log.isInfoEnabled() )
-            {
-                log.info( "Created UDPDiscoveryService for TCP lateral cache." );
+                if ( log.isInfoEnabled() )
+                {
+                    log.info( "Created UDPDiscoveryService for TCP lateral cache." );
+                }                
             }
         }
         return discovery;

Modified: 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/LateralCacheManager.java?rev=234393&r1=234392&r2=234393&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/LateralCacheManager.java Sun Aug 21 17:12:06 2005
@@ -257,7 +257,7 @@
                 }
                 else if ( this.lca.getTransmissionType() == ILateralCacheAttributes.JAVAGROUPS )
                 {
-                    addLateralCacheListener( cacheName, LateralCacheJGListener.getInstance( this.lca ) );
+                    addLateralCacheListener( cacheName, LateralCacheJGListener.getInstance( this.lca, cacheMgr ) );
                 }
             }
             catch ( IOException ioe )

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheListener.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheListener.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheListener.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/behavior/ILateralCacheListener.java Sun Aug 21 17:12:06 2005
@@ -16,7 +16,9 @@
  * limitations under the License.
  */
 
+import org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPListener;
 import org.apache.jcs.engine.behavior.ICacheListener;
+import org.apache.jcs.engine.behavior.ICompositeCacheManager;
 
 /**
  * Listens for lateral cache event notification.
@@ -28,5 +30,16 @@
 
     /** Description of the Method */
     public void init();
+
+    /**
+     * @param cacheMgr The cacheMgr to set.
+     */
+    public void setCacheManager( ICompositeCacheManager cacheMgr );
+
+
+    /**
+     * @return Returns the cacheMgr.
+     */
+    public ICompositeCacheManager getCacheManager();
 
 }

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/JGConnectionHolder.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/JGConnectionHolder.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/JGConnectionHolder.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/JGConnectionHolder.java Sun Aug 21 17:12:06 2005
@@ -57,9 +57,8 @@
     public static JGConnectionHolder getInstance( ILateralCacheAttributes ilca )
     {
         //throws IOException, NotBoundException
-        JGConnectionHolder ins = (JGConnectionHolder) instances.get( ilca.getJGChannelProperties() );
-        //JGConnectionHolder ins = (JGConnectionHolder) instances.get(
-        // ilca.getCacheName() );
+        //JGConnectionHolder ins = (JGConnectionHolder) instances.get( ilca.getJGChannelProperties() );
+        JGConnectionHolder ins = (JGConnectionHolder) instances.get( ilca.getCacheName() );
         try
         {
             synchronized ( JGConnectionHolder.class )
@@ -94,9 +93,9 @@
     }
 
     /**
-     * Gets the {3} attribute of the JGConnectionHolder object
+     * Creates a channel.
      * 
-     * @return The {3} value
+     * @return channel
      * @exception IOException
      */
     public synchronized Channel getChannel()
@@ -104,12 +103,15 @@
     {
         if ( jg == null )
         {
-            jg = JGSocketOpener.openSocket( ilca, 5000, IJGConstants.DEFAULT_JG_GROUP_NAME );
-            //jg = JGSocketOpener.openSocket( ilca, 5000,
-            // this.ilca.getCacheName() );
+            //jg = JGSocketOpener.openSocket( ilca, 5000, IJGConstants.DEFAULT_JG_GROUP_NAME );
+            jg = JGSocketOpener.openSocket( ilca, 5000, this.ilca.getCacheName() );
             if ( log.isInfoEnabled() )
             {
                 log.info( "Created channel " + jg + " for region name " + this.ilca.getCacheName() );
+                if ( jg != null )
+                {
+                    log.info( "Channel connection status; Connected = " + jg.isConnected() + " Open = " + jg.isOpen() );                    
+                }
             }
         }
         return jg;

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralCacheJGListener.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralCacheJGListener.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralCacheJGListener.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralCacheJGListener.java Sun Aug 21 17:12:06 2005
@@ -28,6 +28,7 @@
 import org.apache.jcs.auxiliary.lateral.javagroups.behavior.ILateralCacheJGListener;
 import org.apache.jcs.engine.behavior.ICache;
 import org.apache.jcs.engine.behavior.ICacheElement;
+import org.apache.jcs.engine.behavior.ICompositeCacheManager;
 import org.apache.jcs.engine.control.CompositeCache;
 import org.apache.jcs.engine.control.CompositeCacheManager;
 
@@ -45,7 +46,7 @@
     /**
      * Description of the Field
      */
-    protected static transient CompositeCacheManager cacheMgr;
+    protected transient ICompositeCacheManager cacheMgr;
 
     /**
      * Description of the Field
@@ -136,7 +137,7 @@
      * @return The instance value
      * @param ilca
      */
-    public static ILateralCacheListener getInstance( ILateralCacheAttributes ilca )
+    public static ILateralCacheListener getInstance( ILateralCacheAttributes ilca, ICompositeCacheManager cacheMgr )
     {
 
         //throws IOException, NotBoundException
@@ -147,6 +148,9 @@
             if ( ins == null )
             {
                 ins = new LateralCacheJGListener( ilca );
+                
+                ins.setCacheManager( cacheMgr );
+                
                 ins.init();
             }
             if ( log.isInfoEnabled() )
@@ -253,9 +257,9 @@
         if ( log.isDebugEnabled() )
         {
             log.debug( "handleDispose> cacheName=" + cacheName );
-        }
-        CompositeCacheManager cm = cacheMgr;
-        cm.freeCache( cacheName, true );
+        }    
+        // TODO handle active disposal
+        //this.getCacheManager().freeCache( cacheName, true );
     }
 
     /**
@@ -274,6 +278,22 @@
         }
 
         return cacheMgr.getCache( name );
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheListener#setCacheManager(org.apache.jcs.engine.behavior.ICompositeCacheManager)
+     */
+    public void setCacheManager( ICompositeCacheManager cacheMgr )
+    {
+        this.cacheMgr = cacheMgr;        
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheListener#getCacheManager()
+     */
+    public ICompositeCacheManager getCacheManager()
+    {
+        return this.cacheMgr;
     }
 
 }

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralGroupCacheJGListener.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralGroupCacheJGListener.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralGroupCacheJGListener.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralGroupCacheJGListener.java Sun Aug 21 17:12:06 2005
@@ -78,7 +78,7 @@
     /**
      * Gets the cacheManager attribute of the LateralGroupCacheJGListener object
      */
-    protected void getCacheManager()
+    protected void ensureCacheManager()
     {
         try
         {

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiverConnection.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiverConnection.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiverConnection.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiverConnection.java Sun Aug 21 17:12:06 2005
@@ -63,9 +63,11 @@
      */
     public void run()
     {
+        Object obj = null;
         try
         {
-            LateralElementDescriptor led = (LateralElementDescriptor) mes.getObject();
+            obj = mes.getObject();
+            LateralElementDescriptor led = (LateralElementDescriptor)obj;
             if ( led == null )
             {
                 log.warn( "LateralElementDescriptor is null! Can't do anything." );
@@ -102,15 +104,15 @@
         }
         catch ( java.io.EOFException e )
         {
-            log.info( "Caught java.io.EOFException closing conneciton." );
+            log.info( "Caught java.io.EOFException closing connection." );
         }
         catch ( java.net.SocketException e )
         {
-            log.info( "Caught java.net.SocketException closing conneciton." );
+            log.info( "Caught java.net.SocketException closing connection." );
         }
         catch ( Exception e )
         {
-            log.error( "Unexpected exception.", e );
+            log.error( "Unexpected exception. obj = " + obj, e );
         }
     }
 

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGSender.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGSender.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGSender.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGSender.java Sun Aug 21 17:12:06 2005
@@ -62,8 +62,6 @@
 
     private JGConnectionHolder holder;
 
-    //private ObjectOutputStream oos;
-    //private Socket socket;
     int counter = 0;
 
     /**
@@ -113,7 +111,7 @@
         }
         catch ( Exception e )
         {
-            log.debug( "Could not connect to channel" + ". Exception is " + e );
+            log.debug( "Could not connect to channel.", e );
             throw new IOException( e.getMessage() );
         }
 
@@ -207,7 +205,7 @@
         }
         catch ( Exception e )
         {
-            log.error( "Detected problem with connection: " + e );
+            log.error( "Detected problem with connection.", e );
             throw new IOException( e.getMessage() );
         }
         //        }

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/utils/JGRpcOpener.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/utils/JGRpcOpener.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/utils/JGRpcOpener.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/utils/JGRpcOpener.java Sun Aug 21 17:12:06 2005
@@ -97,10 +97,15 @@
             disp = new RpcDispatcher( rpcCh, null, null, ilcl );
             rpcCh.connect( groupName );
 
+            if ( log.isInfoEnabled() )
+            {
+                log.info( "Is Connected = " + rpcCh.isConnected() );
+            }
+            
         }
         catch ( Exception e )
         {
-            log.error( e );
+            log.error( "Problem getting dispatcher.", e );
         }
     }
 

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/utils/JGSocketOpener.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/utils/JGSocketOpener.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/utils/JGSocketOpener.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/javagroups/utils/JGSocketOpener.java Sun Aug 21 17:12:06 2005
@@ -20,7 +20,8 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
 import org.jgroups.Channel;
-import org.jgroups.JChannel;
+import org.jgroups.ChannelFactory;
+import org.jgroups.JChannelFactory;
 
 /**
  * Socket openere that will timeout on the initial connect rather than block
@@ -80,15 +81,27 @@
         try
         {
 
-            javagroups = new JChannel( lca.getJGChannelProperties() );
+            ChannelFactory factory = new JChannelFactory();
+
+            // Create a channel based on 'channelProperties' from the config
+            Channel channel = factory.createChannel( lca.getJGChannelProperties() );
+
+            javagroups = channel; //new JChannel( lca.getJGChannelProperties()
+                                  // );
             // don't send local
             javagroups.setOpt( Channel.LOCAL, Boolean.FALSE );
+
             javagroups.connect( groupName );
 
+            if ( log.isInfoEnabled() )
+            {
+                log.info( "Is Connected = " + javagroups.isConnected() );
+            }
+
         }
         catch ( Exception e )
         {
-            log.error( " Problem connecting", e );
+            log.error( "Problem connecting to channel.", e );
         }
     }
 

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java Sun Aug 21 17:12:06 2005
@@ -25,7 +25,6 @@
 import java.net.Socket;
 import java.util.HashMap;
 
-import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jcs.auxiliary.lateral.LateralCacheInfo;
@@ -37,10 +36,11 @@
 import org.apache.jcs.engine.control.CompositeCache;
 import org.apache.jcs.engine.control.CompositeCacheManager;
 
+import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;
+
 /**
  * Listens for connections from other TCP lateral caches and handles them.
- * 
- * @version $Id$
+ *  
  */
 public class LateralTCPListener
     implements ILateralCacheListener, Serializable
@@ -51,7 +51,7 @@
     private final static int acceptTimeOut = 0;
 
     /** The CacheHub this listener is associated with */
-    protected static transient CompositeCacheManager cacheMgr;
+    private transient ICompositeCacheManager cacheManager;
 
     /** Map of available instances, keyed by port */
     protected final static HashMap instances = new HashMap();
@@ -71,6 +71,12 @@
 
     private int removeCnt = 0;
 
+    /**
+     * Use the vmid by default.  This can be set for testing. 
+     * If we ever need to run more than one per vm, then we need a new technique.
+     */
+    private long listenerId = LateralCacheInfo.listenerId;
+
     // -------------------------------------------------------- factory methods
 
     /**
@@ -79,7 +85,8 @@
      * @param ilca
      * @return The instance value
      */
-    public synchronized static ILateralCacheListener getInstance( ILateralCacheAttributes ilca, ICompositeCacheManager cacheMgr )
+    public synchronized static ILateralCacheListener getInstance( ILateralCacheAttributes ilca,
+                                                                 ICompositeCacheManager cacheMgr )
     {
         ILateralCacheListener ins = (ILateralCacheListener) instances.get( String.valueOf( ilca.getTcpListenerPort() ) );
 
@@ -89,6 +96,8 @@
 
             ins.init();
 
+            ins.setCacheManager( cacheMgr );
+
             instances.put( String.valueOf( ilca.getTcpListenerPort() ), ins );
 
             if ( log.isDebugEnabled() )
@@ -141,6 +150,12 @@
      * reconnect.
      * <p>
      * By default, the listener id is the vmid.
+     * <p>
+     * The service should set this value. This value will never be changed by a
+     * server we connect to. It needs to be non static, for unit tests.
+     * <p>
+     * The service will use the value it sets in all send requests to the
+     * sender.
      * 
      * @param id
      *            The new listenerId value
@@ -149,7 +164,7 @@
     public void setListenerId( long id )
         throws IOException
     {
-        LateralCacheInfo.listenerId = id;
+        this.listenerId = id;
         if ( log.isDebugEnabled() )
         {
             log.debug( "set listenerId = " + id );
@@ -165,7 +180,7 @@
     public long getListenerId()
         throws IOException
     {
-        return LateralCacheInfo.listenerId;
+        return this.listenerId;
     }
 
     /*
@@ -181,7 +196,7 @@
         {
             if ( getPutCnt() % 100 == 0 )
             {
-                log.info( "Put Count = " + getPutCnt() );
+                log.info( "Put Count (port " + ilca.getTcpListenerPort() + ") = " + getPutCnt() );
             }
         }
 
@@ -265,34 +280,41 @@
             log.info( "handleDispose > cacheName=" + cacheName );
         }
 
-        CompositeCacheManager cm = cacheMgr;
-        cm.freeCache( cacheName, true );
+        // TODO handle active deregistration, rather than passive detection
+        // through error
+        //getCacheManager().freeCache( cacheName, true );
     }
 
     /**
      * Gets the cacheManager attribute of the LateralCacheTCPListener object.
+     * <p>
+     * Normally this is set by the factory.  If it wasn't set the listener defaults
+     * to the expected singleton behavior of the cache amanger.
      * 
      * @param name
      * @return CompositeCache
      */
     protected CompositeCache getCache( String name )
     {
-        if ( cacheMgr == null )
+        if ( getCacheManager() == null )
         {
-            cacheMgr = CompositeCacheManager.getInstance();
+            // revert to singleton on failure
+            setCacheManager( CompositeCacheManager.getInstance() );
 
             if ( log.isDebugEnabled() )
             {
-                log.debug( "cacheMgr = " + cacheMgr );
+                log.debug( "cacheMgr = " + getCacheManager() );
             }
         }
 
-        return cacheMgr.getCache( name );
+        return getCacheManager().getCache( name );
     }
 
     // ---------------------------------------------------------- inner classes
 
     /**
+     * This is roughly the number of updates the lateral has received.
+     * 
      * @return Returns the putCnt.
      */
     public int getPutCnt()
@@ -309,6 +331,23 @@
     }
 
     /**
+     * @param cacheMgr
+     *            The cacheMgr to set.
+     */
+    public void setCacheManager( ICompositeCacheManager cacheMgr )
+    {
+        this.cacheManager = cacheMgr;
+    }
+
+    /**
+     * @return Returns the cacheMgr.
+     */
+    public ICompositeCacheManager getCacheManager()
+    {
+        return cacheManager;
+    }
+
+    /**
      * Processes commands from the server socket. There should be one listener
      * for each configured TCP lateral.
      */
@@ -386,7 +425,7 @@
             }
             catch ( Exception e )
             {
-                log.error( "Could not open ObjectInputStream to " + socket, e );
+                log.error( "Could not open ObjectInputStream on " + socket, e );
 
                 return;
             }
@@ -404,7 +443,7 @@
                         log.debug( "LateralElementDescriptor is null" );
                         continue;
                     }
-                    if ( led.requesterId == LateralCacheInfo.listenerId )
+                    if ( led.requesterId == getListenerId() )
                     {
                         log.debug( "from self" );
                     }
@@ -430,7 +469,7 @@
             }
             catch ( Exception e )
             {
-                log.error( "Unexpected exception. Closing conneciton", e );
+                log.error( "Unexpected exception.", e );
             }
 
             try
@@ -439,7 +478,7 @@
             }
             catch ( Exception e )
             {
-                log.error( "Could not close connection", e );
+                log.error( "Could not close object input stream.", e );
             }
         }
 

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=234393&r1=234392&r2=234393&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 Aug 21 17:12:06 2005
@@ -17,29 +17,21 @@
  */
 
 import java.io.BufferedReader;
-import java.io.InputStreamReader;
 import java.io.IOException;
+import java.io.InputStreamReader;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
 import java.net.InetAddress;
 import java.net.Socket;
 
-import org.apache.jcs.auxiliary.lateral.LateralCacheInfo;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.jcs.auxiliary.lateral.LateralElementDescriptor;
-
 import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
-
 import org.apache.jcs.auxiliary.lateral.socket.tcp.utils.SocketOpener;
-
 import org.apache.jcs.engine.CacheElement;
-
 import org.apache.jcs.engine.behavior.ICacheElement;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 /**
  * This class is based on the log4j SocketAppender class. I'm using a differnet
  * repair structure, so it is significant;y different.
@@ -71,10 +63,10 @@
     private final static int RESET_FREQUENCY = 70;
 
     /**
-     * Only block for 10 seconds before timing out on a read. TODO: make
-     * configurable. The default 10 it way too long.
+     * Only block for 1 second before timing out on a read. TODO: make
+     * configurable. The default 1 is way too long.
      */
-    private final static int timeOut = 10000;
+    private final static int timeOut = 1000;
 
     /** Only block for 5 seconds before timing out on startup. */
     private final static int openTimeOut = 5000;
@@ -91,22 +83,26 @@
     public LateralTCPSender( ILateralCacheAttributes lca )
         throws IOException
     {
+        this.ilca = lca;
+
         String p1 = lca.getTcpServer();
-        String h2 = p1.substring( 0, p1.indexOf( ":" ) );
-        int po = Integer.parseInt( p1.substring( p1.indexOf( ":" ) + 1 ) );
-        if ( log.isDebugEnabled() )
+        if ( p1 != null )
         {
-            log.debug( "h2 = " + h2 );
-            log.debug( "po = " + po );
-        }
+            String h2 = p1.substring( 0, p1.indexOf( ":" ) );
+            int po = Integer.parseInt( p1.substring( p1.indexOf( ":" ) + 1 ) );
+            if ( log.isDebugEnabled() )
+            {
+                log.debug( "h2 = " + h2 );
+                log.debug( "po = " + po );
+            }
 
-        if ( h2 == null )
-        {
-            throw new IOException( "Cannot connect to invalid address " + h2 + ":" + po );
-        }
+            if ( h2 == null )
+            {
+                throw new IOException( "Cannot connect to invalid address " + h2 + ":" + po );
+            }
 
-        init( h2, po );
-        this.ilca = lca;
+            init( h2, po );
+        }
     }
 
     /** Description of the Method */
@@ -176,7 +172,7 @@
         {
             if ( sendCnt % 100 == 0 )
             {
-                log.info( "Send Count = " + sendCnt );
+                log.info( "Send Count (port " + port + ") = " + sendCnt );
             }
         }
 
@@ -317,42 +313,6 @@
 
     }// end sendAndReceive
 
-    // Service Methods //
-    /** Description of the Method */
-    public void update( ICacheElement item, long requesterId )
-        throws IOException
-    {
-        LateralElementDescriptor led = new LateralElementDescriptor( item );
-        led.requesterId = requesterId;
-        led.command = LateralElementDescriptor.UPDATE;
-        send( led );
-    }
-
-    /** Description of the Method */
-    public void remove( String cacheName, Serializable key )
-        throws IOException
-    {
-        remove( cacheName, key, LateralCacheInfo.listenerId );
-    }
-
-    /** Description of the Method */
-    public void remove( String cacheName, Serializable key, long requesterId )
-        throws IOException
-    {
-        CacheElement ce = new CacheElement( cacheName, key, null );
-        LateralElementDescriptor led = new LateralElementDescriptor( ce );
-        led.requesterId = requesterId;
-        led.command = LateralElementDescriptor.REMOVE;
-        send( led );
-    }
-
-    /** Description of the Method */
-    public void release()
-        throws IOException
-    {
-        // nothing needs to be done
-    }
-
     /**
      * Closes connection used by all LateralTCPSenders for this lateral
      * conneciton. Dispose request should come into the facade and be sent to
@@ -364,24 +324,6 @@
     {
         // WILL CLOSE CONNECTION USED BY ALL
         oos.close();
-    }
-
-    /** Description of the Method */
-    public void removeAll( String cacheName )
-        throws IOException
-    {
-        removeAll( cacheName, LateralCacheInfo.listenerId );
-    }
-
-    /** Description of the Method */
-    public void removeAll( String cacheName, long requesterId )
-        throws IOException
-    {
-        CacheElement ce = new CacheElement( cacheName, "ALL", null );
-        LateralElementDescriptor led = new LateralElementDescriptor( ce );
-        led.requesterId = requesterId;
-        led.command = LateralElementDescriptor.REMOVEALL;
-        send( led );
     }
 
     /** Description of the Method */

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPService.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPService.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPService.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPService.java Sun Aug 21 17:12:06 2005
@@ -53,6 +53,11 @@
     private LateralTCPSender sender;
 
     /**
+     * use the vmid by default
+     */
+    private long listenerId = LateralCacheInfo.listenerId;
+    
+    /**
      * Constructor for the LateralTCPService object
      * 
      * @param lca
@@ -87,7 +92,7 @@
     public void update( ICacheElement item )
         throws IOException
     {
-        update( item, LateralCacheInfo.listenerId );
+        update( item, getListenerId() );
     }
 
     /*
@@ -114,7 +119,7 @@
     public void remove( String cacheName, Serializable key )
         throws IOException
     {
-        remove( cacheName, key, LateralCacheInfo.listenerId );
+        remove( cacheName, key, getListenerId() );
     }
 
     /*
@@ -202,7 +207,7 @@
     public void removeAll( String cacheName )
         throws IOException
     {
-        removeAll( cacheName, LateralCacheInfo.listenerId );
+        removeAll( cacheName, getListenerId() );
     }
 
     /*
@@ -300,6 +305,22 @@
         throws IOException
     {
         // Empty
+    }
+
+    /**
+     * @param listernId The listernId to set.
+     */
+    protected void setListenerId( long listernId )
+    {
+        this.listenerId = listernId;
+    }
+
+    /**
+     * @return Returns the listernId.
+     */
+    protected long getListenerId()
+    {
+        return listenerId;
     }
 
 }

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java Sun Aug 21 17:12:06 2005
@@ -31,7 +31,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheListener;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheObserver;

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerListener.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerListener.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerListener.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerListener.java Sun Aug 21 17:12:06 2005
@@ -18,25 +18,19 @@
 
 import java.io.IOException;
 import java.io.Serializable;
-
 import java.rmi.RemoteException;
-
 import java.rmi.server.UnicastRemoteObject;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheConstants;
 import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheListener;
-
 import org.apache.jcs.engine.behavior.ICache;
 import org.apache.jcs.engine.behavior.ICacheElement;
-
 import org.apache.jcs.engine.control.CompositeCache;
 import org.apache.jcs.engine.control.CompositeCacheManager;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-// remove
 
 /**
  * This listener class is for inter cache commumication.

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCache.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCache.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCache.java Sun Aug 21 17:12:06 2005
@@ -34,7 +34,6 @@
 import org.apache.jcs.engine.behavior.ICache;
 import org.apache.jcs.engine.behavior.ICacheElement;
 import org.apache.jcs.engine.behavior.ICacheType;
-import org.apache.jcs.engine.behavior.ICompositeCache;
 import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
 import org.apache.jcs.engine.behavior.IElementAttributes;
 
@@ -64,7 +63,7 @@
  * @version $Id$
  */
 public class CompositeCache
-    implements ICache, Serializable, ICompositeCache
+    implements ICache, Serializable
 {
     private final static Log log = LogFactory.getLog( CompositeCache.class );
 
@@ -75,7 +74,7 @@
     public static IElementEventQueue elementEventQ = new ElementEventQueue( "AllRegionQueue" );
 
     // Auxiliary caches.
-    private AuxiliaryCache[] auxCaches;
+    private AuxiliaryCache[] auxCaches = new AuxiliaryCache[0];
 
     private boolean alive = true;
 
@@ -93,6 +92,9 @@
     public ICompositeCacheAttributes cacheAttr;
 
     // Statistics
+    private int updateCount;
+
+    private int removeCount;
 
     /** Memory cache hit count */
     private int hitCountRam;
@@ -199,6 +201,9 @@
         throws IOException
     {
 
+        // not thread safe, but just for debugging and testing.
+        updateCount++;
+        
         if ( ce.getKey() instanceof String && ce.getKey().toString().endsWith( CacheConstants.NAME_COMPONENT_DELIMITER ) )
         {
             throw new IllegalArgumentException( "key must not end with " + CacheConstants.NAME_COMPONENT_DELIMITER
@@ -310,7 +315,7 @@
     }
 
     /**
-     * Writes the specified element to any disk auxilliaries Might want to
+     * Writes the specified element to any disk auxilliaries .Might want to
      * rename this "overflow" incase the hub wants to do something else.
      * 
      * @param ce
@@ -510,6 +515,10 @@
 
                                 missCountExpired++;
 
+                                // this will tell the remotes to remove the item based on this
+                                // local's expiration policy.  
+                                // This seems wrong.  
+                                //TODO We should call localRemove
                                 remove( key );
 
                                 element = null;
@@ -539,7 +548,7 @@
                                 {
                                     if ( log.isDebugEnabled() )
                                     {
-                                        log.debug( "Skipping memory update since" + "no items are allowed in memory" );
+                                        log.debug( "Skipping memory update since no items are allowed in memory" );
                                     }
                                 }
                             }
@@ -698,6 +707,9 @@
      */
     protected synchronized boolean remove( Serializable key, boolean localOnly )
     {
+        // not thread safe, but just for debugging and testing.
+        removeCount++;
+        
         boolean removed = false;
 
         try
@@ -763,6 +775,7 @@
     }
 
     /**
+     * Will not pass the remove message remotely.  
      * 
      * @throws IOException
      */
@@ -775,7 +788,8 @@
     /**
      * Removes all cached items.
      * 
-     * @param localOnly
+     * @param localOnly, must pass in false to get remote and lateral aux's updated.  This prevents
+     * looping.
      * @throws IOException
      */
     protected synchronized void removeAll( boolean localOnly )
@@ -838,7 +852,7 @@
      * 
      * @param fromRemote
      */
-    protected synchronized void dispose( boolean fromRemote )
+    public synchronized void dispose( boolean fromRemote )
     {
         // If already disposed, return immediately
 
@@ -1228,6 +1242,9 @@
     /**
      * If there are event handlers for the item, then create an event and queue
      * it up.
+     * <p>
+     * This does not call handle directly; instead the handler and the event are put into a queue.  
+     * This prevents the event handling from blocking normal cache operations.
      * 
      * @param ce
      * @param eventType
@@ -1261,7 +1278,7 @@
     }
 
     /**
-     * Adds an ElementEvent to be handled
+     * Adds an ElementEvent to be handled tot he queue.
      * 
      * @param hand
      *            The IElementEventHandler
@@ -1278,5 +1295,37 @@
             log.debug( "Adding event to Element Event Queue" );
         }
         elementEventQ.addElementEvent( hand, event );
+    }
+
+    /**
+     * @param updateCount The updateCount to set.
+     */
+    public void setUpdateCount( int updateCount )
+    {
+        this.updateCount = updateCount;
+    }
+
+    /**
+     * @return Returns the updateCount.
+     */
+    public int getUpdateCount()
+    {
+        return updateCount;
+    }
+
+    /**
+     * @param removeCount The removeCount to set.
+     */
+    public void setRemoveCount( int removeCount )
+    {
+        this.removeCount = removeCount;
+    }
+
+    /**
+     * @return Returns the removeCount.
+     */
+    public int getRemoveCount()
+    {
+        return removeCount;
     }
 }

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheConfigurator.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheConfigurator.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheConfigurator.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCacheConfigurator.java Sun Aug 21 17:12:06 2005
@@ -101,17 +101,17 @@
         doConfigure( props );
     }
 
-    /** 
+    /**
      * Configure cache for properties object.
      * <p>
      * This method proceeds in several steps:
      * <ul>
-     * <li> Store props for use by non configured caches.
-     * <li> Set default value list
-     * <li> Set default cache attr
-     * <li> Set default element attr
-     * <li> Setup system caches to be used
-     * <li> Setup preconfigured caches
+     * <li>Store props for use by non configured caches.
+     * <li>Set default value list
+     * <li>Set default cache attr
+     * <li>Set default element attr
+     * <li>Setup system caches to be used
+     * <li>Setup preconfigured caches
      * </ul>
      * 
      * @param properties
@@ -137,7 +137,7 @@
 
     }
 
-    /** 
+    /**
      * Set the default aux list for new caches.
      * 
      * @param props
@@ -164,7 +164,7 @@
         log.info( "setting defaultCompositeCacheAttributes to " + icca );
     }
 
-    /** 
+    /**
      * Set the default ElementAttributes for new caches.
      * 
      * @param props

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractMemoryCache.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractMemoryCache.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractMemoryCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/AbstractMemoryCache.java Sun Aug 21 17:12:06 2005
@@ -16,15 +16,24 @@
  * limitations under the License.
  */
 
-import java.io.*;
-import java.util.*;
-
-import org.apache.commons.logging.*;
-import org.apache.jcs.engine.*;
-import org.apache.jcs.engine.behavior.*;
-import org.apache.jcs.engine.control.*;
-import org.apache.jcs.engine.control.group.*;
-import org.apache.jcs.engine.memory.shrinking.*;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jcs.engine.CacheConstants;
+import org.apache.jcs.engine.behavior.ICacheElement;
+import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
+import org.apache.jcs.engine.behavior.IElementAttributes;
+import org.apache.jcs.engine.control.CompositeCache;
+import org.apache.jcs.engine.control.group.GroupAttrName;
+import org.apache.jcs.engine.control.group.GroupId;
+import org.apache.jcs.engine.memory.shrinking.ShrinkerThread;
 import org.apache.jcs.engine.stats.Stats;
 import org.apache.jcs.engine.stats.behavior.IStats;
 
@@ -282,8 +291,8 @@
      * @return The cache value
      */
     public CompositeCache getCompositeCache()
-    {
-        return this.cache;
+    { 
+        return this.cache; 
     }
 
     public Set getGroupKeys( String groupName )

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/behavior/IMemoryCache.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/behavior/IMemoryCache.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/behavior/IMemoryCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/behavior/IMemoryCache.java Sun Aug 21 17:12:06 2005
@@ -18,7 +18,6 @@
 
 import java.io.IOException;
 import java.io.Serializable;
-
 import java.util.Iterator;
 
 import org.apache.jcs.engine.behavior.ICacheElement;
@@ -55,7 +54,6 @@
      * @return The size value
      */
     //public void makeFirst( MemoryElementDescriptor me );
-
     //public void moveToMemory( ICacheElement ce );
     /**
      * Gets the size attribute of the IMemoryCache object

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/lru/LRUMemoryCache.java Sun Aug 21 17:12:06 2005
@@ -29,10 +29,9 @@
 import org.apache.jcs.engine.CacheElement;
 import org.apache.jcs.engine.behavior.ICacheElement;
 import org.apache.jcs.engine.control.CompositeCache;
-import org.apache.jcs.engine.memory.AbstractMemoryCache;
-import org.apache.jcs.engine.control.group.GroupId;
 import org.apache.jcs.engine.control.group.GroupAttrName;
-
+import org.apache.jcs.engine.control.group.GroupId;
+import org.apache.jcs.engine.memory.AbstractMemoryCache;
 import org.apache.jcs.engine.memory.util.DoubleLinkedList;
 import org.apache.jcs.engine.memory.util.MemoryElementDescriptor;
 import org.apache.jcs.engine.stats.StatElement;

Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/mru/MRUMemoryCache.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/mru/MRUMemoryCache.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/mru/MRUMemoryCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/memory/mru/MRUMemoryCache.java Sun Aug 21 17:12:06 2005
@@ -29,13 +29,13 @@
 import org.apache.jcs.engine.CacheConstants;
 import org.apache.jcs.engine.behavior.ICacheElement;
 import org.apache.jcs.engine.control.CompositeCache;
+import org.apache.jcs.engine.control.group.GroupAttrName;
+import org.apache.jcs.engine.control.group.GroupId;
 import org.apache.jcs.engine.memory.AbstractMemoryCache;
 import org.apache.jcs.engine.stats.StatElement;
 import org.apache.jcs.engine.stats.Stats;
 import org.apache.jcs.engine.stats.behavior.IStatElement;
 import org.apache.jcs.engine.stats.behavior.IStats;
-import org.apache.jcs.engine.control.group.GroupId;
-import org.apache.jcs.engine.control.group.GroupAttrName;
 
 /**
  * A SLOW AS HELL reference management system. The most recently used items move

Modified: jakarta/jcs/trunk/src/test-conf/TestTCPLateralCache.ccf
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/test-conf/TestTCPLateralCache.ccf?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test-conf/TestTCPLateralCache.ccf (original)
+++ jakarta/jcs/trunk/src/test-conf/TestTCPLateralCache.ccf Sun Aug 21 17:12:06 2005
@@ -1,16 +1,10 @@
 # Cache configuration for the 'TestDiskCache' test. The memory cache has a
 # a maximum of 100 objects, so objects should get pushed into the disk cache
 
-jcs.default=
+jcs.default=LTCP
 jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
 jcs.default.cacheattributes.MaxObjects=10000
 jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
-
-# SYSTEM GROUP ID CACHE
-jcs.system.groupIdCache=
-jcs.system.groupIdCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
-jcs.system.groupIdCache.cacheattributes.MaxObjects=10000
-jcs.system.groupIdCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
 
 
 ##### CACHE REGIONS FOR TEST

Modified: jakarta/jcs/trunk/src/test-conf/log4j.properties
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/test-conf/log4j.properties?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test-conf/log4j.properties (original)
+++ jakarta/jcs/trunk/src/test-conf/log4j.properties Sun Aug 21 17:12:06 2005
@@ -5,7 +5,7 @@
 log4j.category.org.apache.jcs.engine.CacheEventQueueFactory=DEBUG
 log4j.category.org.apache.jcs.auxiliary.disk=INFO
 log4j.category.org.apache.jcs.auxiliary.remote=INFO
-log4j.category.org.apache.jcs.auxiliary.lateral=DEBUG
+log4j.category.org.apache.jcs.auxiliary.lateral=INFO
 log4j.category.org.apache.jcs.utils.threadpool=INFO
 
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender

Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/TestDiskCacheConcurrentRandom.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/test/org/apache/jcs/TestDiskCacheConcurrentRandom.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/TestDiskCacheConcurrentRandom.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/TestDiskCacheConcurrentRandom.java Sun Aug 21 17:12:06 2005
@@ -3,6 +3,7 @@
 import junit.framework.*;
 
 import org.apache.jcs.access.TestCacheAccess;
+import org.apache.jcs.engine.control.CompositeCacheManager;
 
 /**
  * This is used by other tests to generate a random load on the disk cache.

Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateral.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateral.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateral.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/lateral/socket/tcp/TestTCPLateral.java Sun Aug 21 17:12:06 2005
@@ -1,13 +1,18 @@
 package org.apache.jcs.auxiliary.lateral.socket.tcp;
 
+import junit.framework.TestCase;
+
 import org.apache.jcs.JCS;
+import org.apache.jcs.auxiliary.AuxiliaryCache;
 import org.apache.jcs.auxiliary.lateral.LateralCacheAttributes;
+import org.apache.jcs.auxiliary.lateral.LateralCacheFactory;
 import org.apache.jcs.auxiliary.lateral.LateralElementDescriptor;
+import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
 import org.apache.jcs.engine.CacheElement;
+import org.apache.jcs.engine.behavior.ICacheElement;
 import org.apache.jcs.engine.behavior.ICompositeCacheManager;
 import org.apache.jcs.engine.control.CompositeCacheManager;
-
-import junit.framework.TestCase;
+import org.apache.jcs.engine.control.CompositeCacheManagerMockImpl;
 
 /**
  * Basic unit tests for the sending and receiving portions of the lateral cache.
@@ -34,7 +39,7 @@
      * 
      * @throws Exception
      */
-    public void SkiptestSimpleSend()
+    public void testSimpleSend()
         throws Exception
     {
 
@@ -53,7 +58,7 @@
         // send to the listener
         LateralTCPSender lur = new LateralTCPSender( lac );
 
-        int numMes = 100;
+        int numMes = 1000;
         for ( int i = 0; i < numMes; i++ )
         {
             String message = "adsfasasfasfasdasf";
@@ -64,11 +69,50 @@
             lur.send( led );
         }
 
-        Thread.sleep( 300 );
+        Thread.sleep( numMes );
 
         System.out.println( "PutCount = " + listener.getPutCnt() );
         assertEquals( "Should have received " + numMes + " by now.", numMes, listener.getPutCnt() );
 
+    }
+
+    public void testReceive()
+        throws Exception
+    {
+        ILateralCacheAttributes lattr = new LateralCacheAttributes();
+        lattr.setTcpListenerPort( 1101 );
+        lattr.setTransmissionTypeName( "TCP" );
+        CompositeCacheManagerMockImpl cacheMgr = new CompositeCacheManagerMockImpl();
+        System.out.println( "mock cache = " + cacheMgr.getCache( "test" ) );
+
+        LateralCacheFactory fact = new LateralCacheFactory();
+        //.getInstance( lattr, cacheMgr );
+        //LateralCacheNoWait nwait1 = (LateralCacheNoWait)lcMgr1.getCache(
+        // "test" );
+        AuxiliaryCache nowait1 = fact.createCache( lattr, cacheMgr );
+
+        //nowait1.update( );
+
+        ILateralCacheAttributes lattr2 = new LateralCacheAttributes();
+        lattr2.setTcpListenerPort( 1102 );
+        lattr2.setTransmissionTypeName( "TCP" );
+        lattr2.setTcpServer( "localhost:1101" );
+
+        LateralTCPService service = new LateralTCPService( lattr2 );
+        service.setListenerId( 123456 );
+
+        int cnt = 100;
+        for ( int i = 0; i < cnt; i++ )
+        {
+            ICacheElement element = new CacheElement( "test", "key" + i, "value1" );
+            service.update( element );
+        }
+
+        Thread.sleep( 1000 );
+
+        System.out.println( "cache. getPutCount = " + cacheMgr.getCache().getUpdateCount() );
+
+        assertEquals( "Didn't get the correct number", cnt, cacheMgr.getCache().getUpdateCount() );
     }
 
 }

Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/engine/memory/lru/TestLRUMemoryCache.java
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/test/org/apache/jcs/engine/memory/lru/TestLRUMemoryCache.java?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/engine/memory/lru/TestLRUMemoryCache.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/engine/memory/lru/TestLRUMemoryCache.java Sun Aug 21 17:12:06 2005
@@ -20,10 +20,19 @@
 import junit.framework.Test;
 import junit.framework.TestCase;
 
+import org.apache.jcs.auxiliary.AuxiliaryCache;
+import org.apache.jcs.auxiliary.lateral.LateralCacheAttributes;
+import org.apache.jcs.auxiliary.lateral.LateralCacheFactory;
+import org.apache.jcs.auxiliary.lateral.LateralCacheManager;
+import org.apache.jcs.auxiliary.lateral.LateralCacheNoWait;
+import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
+import org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPService;
 import org.apache.jcs.engine.CacheElement;
 import org.apache.jcs.engine.behavior.ICacheElement;
+import org.apache.jcs.engine.behavior.ICompositeCacheManager;
 import org.apache.jcs.engine.control.CompositeCache;
 import org.apache.jcs.engine.control.CompositeCacheManager;
+import org.apache.jcs.engine.control.CompositeCacheManagerMockImpl;
 
 /**
  * Test which exercises the LRUMemory cache. This one uses three different
@@ -157,4 +166,7 @@
             assertNull( "Removed key should be null: " + i + ":key", lru.get( i + ":key" ) );
         }
     }
+    
+    
+    
 }

Modified: jakarta/jcs/trunk/xdocs/LateralTCPAuxCache.xml
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/xdocs/LateralTCPAuxCache.xml?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/xdocs/LateralTCPAuxCache.xml (original)
+++ jakarta/jcs/trunk/xdocs/LateralTCPAuxCache.xml Sun Aug 21 17:12:06 2005
@@ -97,6 +97,7 @@
 jcs.auxiliary.LTCP.attributes.Receive=false
         ]]></source>
       </subsection>
+                  
       <subsection name="Potential Issues">
         <p>
           The TCP Lateral Auxiliary Cache can provide a high level of

Modified: jakarta/jcs/trunk/xdocs/navigation.xml
URL: http://svn.apache.org/viewcvs/jakarta/jcs/trunk/xdocs/navigation.xml?rev=234393&r1=234392&r2=234393&view=diff
==============================================================================
--- jakarta/jcs/trunk/xdocs/navigation.xml (original)
+++ jakarta/jcs/trunk/xdocs/navigation.xml Sun Aug 21 17:12:06 2005
@@ -18,12 +18,15 @@
     <menu name="JCS User's Guide">
       <item name="Basic JCS Config"         href="/BasicJCSConfiguration.html"/>
       <item name="Element Config"           href="/ElementAttributes.html"/>
+      <item name="Region Properties"  href="/RegionProperties.html"/>
       <item name="Basic Web Example"        href="/UsingJCSBasicWeb.html"/>
       <item name="Plugin Overview"          href="/Plugins.html"/>
       <item name="Local Cache"              href="/LocalCacheConfig.html"/>
       <item name="Indexed Disk Cache"       href="/IndexedDiskAuxCache.html"/>
+      <item name="Indexed Disk Properties"  href="/IndexedDiskCacheProperties.html"/>
       <item name="Remote Cache"             href="/RemoteAuxCache.html"/>
       <item name="Lateral TCP Cache"        href="/LateralTCPAuxCache.html"/>
+      <item name="Lateral TCP Properties"   href="/LateralTCPProperties.html"/>
       <item name="Lateral UDP Discovery"    href="/LateralUDPDiscovery.html"/>
     </menu>
 



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