This is an automated email from the ASF dual-hosted git repository.

tv pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jcs.git

commit 670642e371c9eebbe7d1cbec001b993cc59e7fbf
Author: Thomas Vandahl <[email protected]>
AuthorDate: Sun Apr 12 19:25:26 2020 +0200

    Remove remains of singleton core
---
 .../lateral/socket/tcp/LateralTCPListener.java      | 17 -----------------
 .../remote/AbstractRemoteCacheListener.java         | 21 ---------------------
 2 files changed, 38 deletions(-)

diff --git 
a/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java
 
b/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java
index 84e68cb..a2c2c36 100644
--- 
a/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java
+++ 
b/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/lateral/socket/tcp/LateralTCPListener.java
@@ -36,7 +36,6 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.apache.commons.jcs.access.exception.CacheException;
 import org.apache.commons.jcs.auxiliary.lateral.LateralElementDescriptor;
 import org.apache.commons.jcs.auxiliary.lateral.behavior.ILateralCacheListener;
 import 
org.apache.commons.jcs.auxiliary.lateral.socket.tcp.behavior.ITCPLateralCacheAttributes;
@@ -45,7 +44,6 @@ import org.apache.commons.jcs.engine.behavior.ICacheElement;
 import org.apache.commons.jcs.engine.behavior.ICompositeCacheManager;
 import org.apache.commons.jcs.engine.behavior.IShutdownObserver;
 import org.apache.commons.jcs.engine.control.CompositeCache;
-import org.apache.commons.jcs.engine.control.CompositeCacheManager;
 import org.apache.commons.jcs.io.ObjectInputStreamClassLoaderAware;
 import org.apache.commons.jcs.log.Log;
 import org.apache.commons.jcs.log.LogManager;
@@ -365,21 +363,6 @@ public class LateralTCPListener<K, V>
      */
     protected CompositeCache<K, V> getCache( String name )
     {
-        if ( getCacheManager() == null )
-        {
-            // revert to singleton on failure
-            try
-            {
-                setCacheManager( CompositeCacheManager.getInstance() );
-            }
-            catch (CacheException e)
-            {
-                throw new RuntimeException("Could not retrieve cache manager 
instance", e);
-            }
-
-            log.debug( "cacheMgr = {0}", () -> getCacheManager() );
-        }
-
         return getCacheManager().getCache( name );
     }
 
diff --git 
a/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/AbstractRemoteCacheListener.java
 
b/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/AbstractRemoteCacheListener.java
index e2681a7..eafbc54 100644
--- 
a/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/AbstractRemoteCacheListener.java
+++ 
b/commons-jcs-core/src/main/java/org/apache/commons/jcs/auxiliary/remote/AbstractRemoteCacheListener.java
@@ -22,7 +22,6 @@ package org.apache.commons.jcs.auxiliary.remote;
 import java.io.IOException;
 import java.net.UnknownHostException;
 
-import org.apache.commons.jcs.access.exception.CacheException;
 import org.apache.commons.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes;
 import org.apache.commons.jcs.auxiliary.remote.behavior.IRemoteCacheListener;
 import org.apache.commons.jcs.auxiliary.remote.server.behavior.RemoteType;
@@ -30,7 +29,6 @@ import org.apache.commons.jcs.engine.behavior.ICacheElement;
 import org.apache.commons.jcs.engine.behavior.ICacheElementSerialized;
 import org.apache.commons.jcs.engine.behavior.ICompositeCacheManager;
 import org.apache.commons.jcs.engine.behavior.IElementSerializer;
-import org.apache.commons.jcs.engine.control.CompositeCacheManager;
 import org.apache.commons.jcs.log.Log;
 import org.apache.commons.jcs.log.LogManager;
 import org.apache.commons.jcs.utils.net.HostNameUtil;
@@ -224,25 +222,6 @@ public abstract class AbstractRemoteCacheListener<K, V>
      */
     protected ICompositeCacheManager getCacheManager()
     {
-        if ( cacheMgr == null )
-        {
-            try
-            {
-                cacheMgr = CompositeCacheManager.getInstance();
-
-                log.debug( "had to get cacheMgr" );
-                log.debug( "cacheMgr = {0}", cacheMgr );
-            }
-            catch (CacheException e)
-            {
-                log.error( "Could not get cacheMgr", e );
-            }
-        }
-        else
-        {
-            log.debug( "already got cacheMgr = {0}", cacheMgr );
-        }
-
         return cacheMgr;
     }
 

Reply via email to