commit 14473bb6744de411385780422e74b70f25999e39
Author: Andreas Müller <a.mueller@bgbm.org>
Date:   Wed Dec 21 11:27:06 2022 +0100

    cleanup and renaming for caching

diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationState.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationState.java
index 4941c2e9f..7b4dea137 100644
--- a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationState.java
+++ b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationState.java
@@ -28,7 +28,7 @@ import org.osgi.framework.BundleException;
 import org.osgi.framework.Constants;
 import org.springframework.security.core.context.SecurityContext;
 
-import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCachingProxy;
 import eu.etaxonomy.cdm.api.service.ICommonService;
 import eu.etaxonomy.cdm.api.service.IService;
 import eu.etaxonomy.cdm.api.service.ITestService;
@@ -54,7 +54,7 @@ public class CdmApplicationState {
     //FIXME SecurityContextHolder.getContext()
     private SecurityContext securityContext;
 
-    private static CdmServiceCacher cdmServiceCacher;
+    private static CdmServiceCachingProxy termProxy;
 
     private static String cdmlibVersion = null;
     private static String cdmlibLastModified = null;
@@ -117,7 +117,7 @@ public class CdmApplicationState {
         getInstance().setAppConfig(null);
         getInstance().setSecurityContext(null);
         cdmApplicationState = null;
-        cdmServiceCacher = null;
+        termProxy = null;
         cdmlibVersion = null;
         cdmlibLastModified = null;
     }
@@ -185,12 +185,12 @@ public class CdmApplicationState {
         return ((CdmApplicationRemoteController)configuration).getCachedCommonService();
     }
 
-    public static CdmServiceCacher getCdmServiceCacher() {
-        return cdmServiceCacher;
+    public static CdmServiceCachingProxy getTermProxy() {
+        return termProxy;
     }
 
-    public static void setCdmServiceCacher(CdmServiceCacher cacher) {
-        cdmServiceCacher = cacher;
+    public static void setTermProxy(CdmServiceCachingProxy cacher) {
+        termProxy = cacher;
     }
 
     public static void updateCdmlibManifestInfo() {
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/cache/CdmServiceCacher.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/cache/CdmServiceCacher.java
deleted file mode 100644
index 7c6fe9cab..000000000
--- a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/cache/CdmServiceCacher.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/**
- * Copyright (C) 2015 EDIT
- * European Distributed Institute of Taxonomy
- * http://www.e-taxonomy.eu
- *
- * The contents of this file are subject to the Mozilla Public License Version 1.1
- * See LICENSE.TXT at the top of this package for the full license terms.
- */
-package eu.etaxonomy.cdm.api.cache;
-
-import java.io.File;
-import java.util.UUID;
-
-import org.springframework.beans.factory.annotation.Autowired;
-
-import eu.etaxonomy.cdm.api.application.CdmApplicationState;
-import eu.etaxonomy.cdm.api.config.EhCacheConfiguration;
-import eu.etaxonomy.cdm.cache.CacheLoader;
-import eu.etaxonomy.cdm.cache.CdmEntityCacheKey;
-import eu.etaxonomy.cdm.cache.CdmTransientEntityCacher;
-import eu.etaxonomy.cdm.config.ConfigFileUtil;
-import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.term.DefinedTermBase;
-import eu.etaxonomy.cdm.model.term.Representation;
-import eu.etaxonomy.cdm.model.term.TermBase;
-import eu.etaxonomy.taxeditor.service.RemoteInvocationTermCacher;
-import eu.etaxonomy.taxeditor.session.CdmEntitySession;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManagerObserver;
-import net.sf.ehcache.config.CacheConfiguration;
-import net.sf.ehcache.config.DiskStoreConfiguration;
-import net.sf.ehcache.config.SizeOfPolicyConfiguration;
-
-/**
- * Class which uses CDM services to cache cdm entities
- *
- * FIXME: Currently only handles term entities. It would be
- *        interesting to have a generic method which finds the
- *        correct service to load / cache the entity.
- *
- * @author cmathew
- */
-public class CdmServiceCacher extends CdmCacherBase implements ICdmEntitySessionManagerObserver {
-
-    private ICdmEntitySessionManager cdmEntitySessionManager;
-
-    private CdmTransientEntityCacher cdmTransientEntityCacher;
-
-    private CacheLoader cacheLoader;
-
-    @Autowired
-    private ConfigFileUtil configFileUtil = null;
-
-    @Override
-    protected void setup() {
-
-        setUpCacheManager();
-
-        DefinedTermBase.setCacher(this);
-        CdmTransientEntityCacher.setPermanentCacher(this);
-        //TermServiceRequestExecutor.setDefaultCacher(this);
-        RemoteInvocationTermCacher.setDefaultCacher(this);
-
-        cacheLoader = new CacheLoader(this);
-    }
-
-    private void setUpCacheManager() {
-
-        EhCacheConfiguration cacheConfig = new EhCacheConfiguration();
-
-        DiskStoreConfiguration diskStoreConfiguration = new DiskStoreConfiguration();
-        File ehcacheFolder = null;
-        if(configFileUtil != null){
-            try {
-                ehcacheFolder = configFileUtil.getCdmHomeSubDir("taxeditor-ehcache");
-            } catch (Exception e){
-                logger.warn("Cannot determine CdmHomeSubDir for ./taxeditor-ehcache, will use fallback method.", e);
-            }
-        }
-        if(ehcacheFolder == null){
-            ehcacheFolder = ConfigFileUtil.getCdmHomeSubDirFallback("taxeditor-ehcache");
-        }
-
-        // FIXME use subfolder per taxeditor version to allow running multiple installations in parallel
-        // String taxEditorVersion = ..;
-        // File ehcacheFolder = new File(ehcacheFolder, taxEditorVersion);
-        diskStoreConfiguration.setPath(ehcacheFolder.getAbsolutePath());
-
-        cacheConfig.setDiskStoreConfiguration(diskStoreConfiguration);
-        addCacheManager(cacheConfig.cacheManager());
-    }
-
-    @Override
-    protected CacheConfiguration getDefaultCacheConfiguration() {
-        // For a better understanding on how to size caches, refer to
-        // http://ehcache.org/documentation/configuration/cache-size
-
-        SizeOfPolicyConfiguration sizeOfConfig = new SizeOfPolicyConfiguration();
-        sizeOfConfig.setMaxDepth(100);
-        sizeOfConfig.setMaxDepthExceededBehavior("abort");
-
-        return new CacheConfiguration(DEFAULT_CACHE_NAME, 0)
-        	.eternal(true)
-        	.statistics(true)
-        	.sizeOfPolicy(sizeOfConfig)
-        	.overflowToOffHeap(false);
-    }
-
-    @Override
-    protected CdmBase findByUuid(UUID uuid) {
-        CdmBase term = CdmApplicationState.getCurrentAppConfig().getTermService().findWithoutFlush(uuid);
-        return load(term);
-    }
-
-    @Override
-    public boolean isCachable(CdmBase cdmEntity) {
-     	if(cdmEntity == null){
-     	    return false;
-     	}else if (cdmEntity instanceof TermBase || cdmEntity instanceof Representation){
-            return true;
-        }else{
-            return false;
-        }
-    }
-
-    public void setCdmEntitySessionManager(ICdmEntitySessionManager cdmEntitySessionManager) {
-        this.cdmEntitySessionManager = cdmEntitySessionManager;
-        if(cdmEntitySessionManager != null) {
-            cdmEntitySessionManager.addSessionObserver(this);
-        }
-    }
-
-    public CdmTransientEntityCacher getCurrentCacher() {
-        ICdmEntitySession cdmEntitySession = cdmEntitySessionManager.getActiveSession();
-        if(cdmEntitySession != null && cdmEntitySession instanceof CdmEntitySession) {
-            return ((CdmEntitySession) cdmEntitySession).getCacher();
-        }
-        return null;
-    }
-
-    @Override
-    public <T extends CdmBase> T  getFromCache(T cdmBase) {
-        T cachedCdmEntity = null;
-        // first we check in the active session cache if the
-        // entity has been loaded there
-        // FIXME:Remoting do we really need the cdmTransientEntityCacher
-        // here. Is it not guaranteed that all every entity which 'isCachable'
-        // by this cacher is cached only in this cacher ?
-        if(!isCachable(cdmBase) && cdmTransientEntityCacher != null) {
-            CdmEntityCacheKey<T> key = CdmTransientEntityCacher.generateKey(cdmBase);
-            cachedCdmEntity = cdmTransientEntityCacher.getFromCache(key);
-        }
-        if(cachedCdmEntity == null) {
-            cachedCdmEntity = super.getFromCache(cdmBase);
-        }
-        return cachedCdmEntity;
-    }
-
-    @Override
-    public <T extends CdmBase> T load(T cdmEntity) {
-        @SuppressWarnings("unchecked")
-        T cachedCdmEntity = (T)getFromCache(cdmEntity.getUuid());
-
-        if(isCachable(cdmEntity) && cachedCdmEntity == null) {
-            cachedCdmEntity = cacheLoader.load(cdmEntity, false, true);
-        }
-        return cachedCdmEntity;
-    }
-
-    @Override
-    public void changed() {
-        ICdmEntitySession cdmEntitySession = cdmEntitySessionManager.getActiveSession();
-        if(cdmEntitySession != null && cdmEntitySession instanceof CdmEntitySession) {
-            this.cdmTransientEntityCacher = ((CdmEntitySession) cdmEntitySession).getCacher();
-        } else {
-            this.cdmTransientEntityCacher = null;
-        }
-    }
-}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/cache/CdmServiceCachingProxy.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/cache/CdmServiceCachingProxy.java
new file mode 100644
index 000000000..2a6815d47
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/cache/CdmServiceCachingProxy.java
@@ -0,0 +1,186 @@
+/**
+ * Copyright (C) 2015 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.cdm.api.cache;
+
+import java.io.File;
+import java.util.UUID;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.config.EhCacheConfiguration;
+import eu.etaxonomy.cdm.cache.CacheLoader;
+import eu.etaxonomy.cdm.cache.CdmEntityCacheKey;
+import eu.etaxonomy.cdm.cache.CdmTransientEntityCacher;
+import eu.etaxonomy.cdm.config.ConfigFileUtil;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.term.DefinedTermBase;
+import eu.etaxonomy.cdm.model.term.Representation;
+import eu.etaxonomy.cdm.model.term.TermBase;
+import eu.etaxonomy.taxeditor.service.RemoteInvocationTermCacher;
+import eu.etaxonomy.taxeditor.session.CdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManagerObserver;
+import net.sf.ehcache.config.CacheConfiguration;
+import net.sf.ehcache.config.DiskStoreConfiguration;
+import net.sf.ehcache.config.SizeOfPolicyConfiguration;
+
+/**
+ * Class which uses CDM services to cache cdm entities
+ *
+ * FIXME: Currently only handles term entities. It would be
+ *        interesting to have a generic method which finds the
+ *        correct service to load / cache the entity.
+ * TODO by AM: compare with {@link CdmTermCacher} and merge if possible
+ *
+ * @author cmathew
+ */
+public class CdmServiceCachingProxy
+        extends CdmCacherBase
+        implements ICdmEntitySessionManagerObserver {
+
+    private ICdmEntitySessionManager cdmEntitySessionManager;
+
+    private CdmTransientEntityCacher cdmTransientEntityCacher;
+
+    private CacheLoader cacheLoader;
+
+    @Autowired
+    private ConfigFileUtil configFileUtil = null;
+
+    @Override
+    protected void setup() {
+
+        setUpCacheManager();
+
+        DefinedTermBase.setCacher(this);
+        CdmTransientEntityCacher.setPermanentCacher(this);
+        //TermServiceRequestExecutor.setDefaultCacher(this);
+        RemoteInvocationTermCacher.setDefaultCacher(this);
+
+        cacheLoader = new CacheLoader(this);
+    }
+
+    private void setUpCacheManager() {
+
+        EhCacheConfiguration cacheConfig = new EhCacheConfiguration();
+
+        DiskStoreConfiguration diskStoreConfiguration = new DiskStoreConfiguration();
+        File ehcacheFolder = null;
+        if(configFileUtil != null){
+            try {
+                ehcacheFolder = configFileUtil.getCdmHomeSubDir("taxeditor-ehcache");
+            } catch (Exception e){
+                logger.warn("Cannot determine CdmHomeSubDir for ./taxeditor-ehcache, will use fallback method.", e);
+            }
+        }
+        if(ehcacheFolder == null){
+            ehcacheFolder = ConfigFileUtil.getCdmHomeSubDirFallback("taxeditor-ehcache");
+        }
+
+        // FIXME use subfolder per taxeditor version to allow running multiple installations in parallel
+        // String taxEditorVersion = ..;
+        // File ehcacheFolder = new File(ehcacheFolder, taxEditorVersion);
+        diskStoreConfiguration.setPath(ehcacheFolder.getAbsolutePath());
+
+        cacheConfig.setDiskStoreConfiguration(diskStoreConfiguration);
+        setCacheManager(cacheConfig.cacheManager());
+    }
+
+    @Override
+    protected CacheConfiguration getDefaultCacheConfiguration() {
+        // For a better understanding on how to size caches, refer to
+        // http://ehcache.org/documentation/configuration/cache-size
+
+        SizeOfPolicyConfiguration sizeOfConfig = new SizeOfPolicyConfiguration();
+        sizeOfConfig.setMaxDepth(100);
+        sizeOfConfig.setMaxDepthExceededBehavior("abort");
+
+        return new CacheConfiguration(DEFAULT_CACHE_NAME, 0)
+        	.eternal(true)
+        	.statistics(true)
+        	.sizeOfPolicy(sizeOfConfig)
+        	.overflowToOffHeap(false);
+    }
+
+    @Override
+    protected CdmBase findByUuid(UUID uuid) {
+        CdmBase term = CdmApplicationState.getCurrentAppConfig().getTermService().findWithoutFlush(uuid);
+        return load(term);
+    }
+
+    /**
+     * <code>true</code> if the parameter is a term or a representation
+     */
+    @Override
+    public boolean isCachable(CdmBase cdmEntity) {
+     	if(cdmEntity == null){
+     	    return false;
+     	}else if (cdmEntity instanceof TermBase || cdmEntity instanceof Representation){
+            return true;
+        }else{
+            return false;
+        }
+    }
+
+    public void setCdmEntitySessionManager(ICdmEntitySessionManager cdmEntitySessionManager) {
+        this.cdmEntitySessionManager = cdmEntitySessionManager;
+        if(cdmEntitySessionManager != null) {
+            cdmEntitySessionManager.addSessionObserver(this);
+        }
+    }
+
+    public CdmTransientEntityCacher getCurrentCacher() {
+        ICdmEntitySession cdmEntitySession = cdmEntitySessionManager.getActiveSession();
+        if(cdmEntitySession != null && cdmEntitySession instanceof CdmEntitySession) {
+            return ((CdmEntitySession) cdmEntitySession).getCacher();
+        }
+        return null;
+    }
+
+    @Override
+    public <T extends CdmBase> T  getFromCache(T cdmBase) {
+        T cachedCdmEntity = null;
+        // first we check in the active session cache if the
+        // entity has been loaded there
+        // FIXME:Remoting do we really need the cdmTransientEntityCacher
+        // here. Is it not guaranteed that every entity which 'isCachable'
+        // by this cacher is cached only in this cacher ?
+        if(!isCachable(cdmBase) && cdmTransientEntityCacher != null) {
+            CdmEntityCacheKey<T> key = CdmTransientEntityCacher.generateKey(cdmBase);
+            cachedCdmEntity = cdmTransientEntityCacher.getFromCache(key);
+        }
+        if(cachedCdmEntity == null) {
+            cachedCdmEntity = super.getFromCache(cdmBase);
+        }
+        return cachedCdmEntity;
+    }
+
+    @Override
+    public <T extends CdmBase> T load(T cdmEntity) {
+        @SuppressWarnings("unchecked")
+        T cachedCdmEntity = (T)getFromCache(cdmEntity.getUuid());
+
+        if(isCachable(cdmEntity) && cachedCdmEntity == null) {
+            cachedCdmEntity = cacheLoader.load(cdmEntity, false, true);
+        }
+        return cachedCdmEntity;
+    }
+
+    @Override
+    public void changed() {
+        ICdmEntitySession cdmEntitySession = cdmEntitySessionManager.getActiveSession();
+        if(cdmEntitySession != null && cdmEntitySession instanceof CdmEntitySession) {
+            this.cdmTransientEntityCacher = ((CdmEntitySession) cdmEntitySession).getCacher();
+        } else {
+            this.cdmTransientEntityCacher = null;
+        }
+    }
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/RemoteInvocationTermCacher.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/RemoteInvocationTermCacher.java
index 8832a57a3..53f666287 100644
--- a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/RemoteInvocationTermCacher.java
+++ b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/RemoteInvocationTermCacher.java
@@ -19,7 +19,7 @@ import org.apache.logging.log4j.Logger;
 import org.springframework.remoting.support.RemoteInvocation;
 import org.springframework.remoting.support.RemoteInvocationResult;
 
-import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCachingProxy;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.term.TermType;
 
@@ -34,9 +34,9 @@ public class RemoteInvocationTermCacher implements IRemoteInvocationTermCacher {
 
 	private static Map<TermType, RemoteInvocationResult> termTypeMap = new HashMap<>();
 
-	private static CdmServiceCacher cdmServiceCacher;
+	private static CdmServiceCachingProxy cdmServiceCacher;
 
-	public static void setDefaultCacher(CdmServiceCacher csc) {
+	public static void setDefaultCacher(CdmServiceCachingProxy csc) {
         cdmServiceCacher = csc;
     }
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java
index 06376caab..1e54f9160 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java
@@ -26,7 +26,7 @@ import eu.etaxonomy.cdm.api.application.CdmApplicationException;
 import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
-import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCachingProxy;
 import eu.etaxonomy.cdm.api.service.IAgentService;
 import eu.etaxonomy.cdm.api.service.IAnnotationService;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
@@ -277,7 +277,7 @@ public class CdmStore {
     public static void setInstance(CdmApplicationRemoteController applicationController,
             ICdmSource cdmSource) {
         instance = new CdmStore(applicationController, cdmSource);
-        CdmApplicationState.setCdmServiceCacher(new CdmServiceCacher());
+        CdmApplicationState.setTermProxy(new CdmServiceCachingProxy());
     }
 
     protected CdmStore(CdmApplicationRemoteController repository,
@@ -290,8 +290,6 @@ public class CdmStore {
 
     /**
      * All calls to the datastore require
-     *
-     * @return
      */
     private CdmApplicationRemoteController getApplicationConfiguration() {
         try {
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/sessions/SessionsViewPart.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/sessions/SessionsViewPart.java
index ec7994803..dbce3d428 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/sessions/SessionsViewPart.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/sessions/SessionsViewPart.java
@@ -295,7 +295,6 @@ public class SessionsViewPart implements ICdmEntitySessionManagerObserver {
             txtCdmModelInMemory.setText(getInMemoryStats(liveCacheStatistics));
             txtCdmModelOnDisk.setText(getOnDiskStats(liveCacheStatistics));
         }
-
     }
 
     private void addSession(ICdmEntitySession session) {
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/BaseRemotingTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/BaseRemotingTest.java
index e4b4cecc6..38a79aeba 100644
--- a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/BaseRemotingTest.java
+++ b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/BaseRemotingTest.java
@@ -25,7 +25,7 @@ import org.unitils.spring.annotation.SpringApplicationContext;
 import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.application.CdmDataChangeService;
-import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCachingProxy;
 import eu.etaxonomy.cdm.cache.CdmRemoteCacheManager;
 import eu.etaxonomy.cdm.model.permission.User;
 import eu.etaxonomy.taxeditor.remoting.cache.ConversationalTransientEntityCacher;
@@ -93,7 +93,7 @@ public abstract class BaseRemotingTest extends ThreadedTest {
                         null,
                         null);
         CdmApplicationState.setCurrentAppConfig(remoteApplicationController);
-        CdmApplicationState.setCdmServiceCacher(new CdmServiceCacher());
+        CdmApplicationState.setTermProxy(new CdmServiceCachingProxy());
 
         cdmEntitySessionManager = getRemoteApplicationController().getCdmEntitySessionManager();
 
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/CdmServiceCacherTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/CdmServiceCacherTest.java
index a42168432..bef18b1b2 100644
--- a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/CdmServiceCacherTest.java
+++ b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/CdmServiceCacherTest.java
@@ -14,7 +14,7 @@ import org.junit.Assert;
 import org.junit.Test;
 
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
-import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCachingProxy;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.taxeditor.httpinvoker.RemotingSessionAwareTest;
 
@@ -23,7 +23,7 @@ public class CdmServiceCacherTest extends RemotingSessionAwareTest {
     @SuppressWarnings("unused")
     private static final Logger logger = LogManager.getLogger(CdmServiceCacherTest.class);
 
-	private static CdmServiceCacher cdmServiceCacher = CdmApplicationState.getCdmServiceCacher();
+	private static CdmServiceCachingProxy cdmServiceCacher = CdmApplicationState.getTermProxy();
 
 	@Test
 	public void testLanguageCache() {
diff --git a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ServiceInterceptorTest.java b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ServiceInterceptorTest.java
index 3bea4b29d..5ba1adbe0 100644
--- a/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ServiceInterceptorTest.java
+++ b/eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ServiceInterceptorTest.java
@@ -9,7 +9,7 @@ import org.junit.Assert;
 import org.junit.Test;
 
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
-import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCachingProxy;
 import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.Language;
@@ -22,7 +22,7 @@ public class ServiceInterceptorTest extends RemotingSessionAwareTest {
 	 @SuppressWarnings("unused")
     private static final Logger logger = LogManager.getLogger(ServiceInterceptorTest.class);
 	 private final ITermService termService = getRemoteApplicationController().getTermService();
-	 private static CdmServiceCacher cdmServiceCacher = CdmApplicationState.getCdmServiceCacher();
+	 private static CdmServiceCachingProxy cdmServiceCacher = CdmApplicationState.getTermProxy();
 
 
 	    @Test
