httpInvokerServiceClients.xml : set 'CdmServiceRequestExecutor' class as default...
authorCherian Mathew <c.mathew@bgbm.org>
Mon, 9 Mar 2015 10:00:44 +0000 (10:00 +0000)
committerCherian Mathew <c.mathew@bgbm.org>
Mon, 9 Mar 2015 10:00:44 +0000 (10:00 +0000)
ICdmEntitySession, CdmEntitySession, MockCdmEntitySession : added method to update session
ICdmEntitySessionManager, CdmEntitySessionManager, MockCdmEntitySessionManager : added methods to set active session, dispose and update sessions
ProxyUtils : added utility method
EntityCacherDebugResult : corrected method to determine cache corresponding to entity
CdmTransientEntityCacher : corrected put method
CacheLoader : optimised recursive call
CdmServiceCacher : corrected methods to get from cache and load
CdmServiceRequestExecutor : added update result return calls to load

14 files changed:
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/cache/CdmServiceCacher.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CacheLoader.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmRemoteCacheManager.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/CdmTransientEntityCacher.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/EntityCacherDebugResult.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/ProxyUtils.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CdmServiceRequestExecutor.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmEntitySession.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionManager.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySession.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySessionManager.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/mock/MockCdmEntitySession.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/mock/MockCdmEntitySessionManager.java
eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/httpInvokerServiceClients.xml

index 0239a7e82bf36e3a11b26cdc49ef7c01ac702873..96c94964cc2fb0698048ac580b0051a8d103a068 100644 (file)
@@ -12,8 +12,12 @@ import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
 import eu.etaxonomy.taxeditor.remoting.cache.CacheLoader;
+import eu.etaxonomy.taxeditor.remoting.cache.CdmEntityCacheKey;
 import eu.etaxonomy.taxeditor.remoting.cache.CdmTransientEntityCacher;
 import eu.etaxonomy.taxeditor.service.TermServiceRequestExecutor;
+import eu.etaxonomy.taxeditor.session.CdmEntitySession;
+import eu.etaxonomy.taxeditor.session.CdmEntitySessionManager;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
 
 /**
  * Class which uses CDM services to cache cdm entities
@@ -27,11 +31,16 @@ import eu.etaxonomy.taxeditor.service.TermServiceRequestExecutor;
  * @param <T>
  */
 @Component
-public class CdmServiceCacher extends CdmCacher{
+public class CdmServiceCacher extends CdmCacher {
 
     @Autowired
     ITermService termService;
 
+    @Autowired
+    private CdmEntitySessionManager cdmEntitySessionManager;
+
+    private CdmTransientEntityCacher cdmTransientEntityCacher;
+
     private CacheLoader cacheLoader;
 
     @Override
@@ -76,18 +85,38 @@ public class CdmServiceCacher extends CdmCacher{
         return false;
     }
 
+    public void setActiveSession(ICdmEntitySession cdmEntitySession) {
+        if(cdmEntitySession != null && cdmEntitySession instanceof CdmEntitySession) {
+            this.cdmTransientEntityCacher = ((CdmEntitySession) cdmEntitySession).getCacher();
+        } else {
+            this.cdmTransientEntityCacher = null;
+        }
+    }
+
+    @Override
+    public CdmBase getFromCache(CdmBase cdmBase) {
+        CdmBase cachedCdmEntity = null;
+        // first we check in the active session cache if the
+        if(!isCachable(cdmBase) && cdmTransientEntityCacher != null) {
+            CdmEntityCacheKey key = CdmTransientEntityCacher.generateKey(cdmBase);
+            cachedCdmEntity = cdmTransientEntityCacher.getFromCache(key);
+
+        }
+        if(cachedCdmEntity == null) {
+            cachedCdmEntity = super.getFromCache(cdmBase);
+        }
+        return cachedCdmEntity;
+    }
+
 
     /* (non-Javadoc)
      * @see eu.etaxonomy.cdm.api.cache.CdmCacher#load(eu.etaxonomy.cdm.model.common.CdmBase)
      */
     @Override
     public CdmBase load(CdmBase cdmEntity) {
-        CdmBase cachedCdmEntity = getFromCache(cdmEntity);
-        // NOTE : only when no cached cdm entity exists we
-        // load the entire sub-graph, which means that the
-        // sub-graph is never updated if the input
-        // cdm entity graph is newer
-        if(cachedCdmEntity == null && isCachable(cdmEntity)) {
+        CdmBase cachedCdmEntity = getFromCache(cdmEntity.getUuid());
+
+        if(isCachable(cdmEntity)) {
             cachedCdmEntity =  cacheLoader.load(cdmEntity, true, false);
         }
         return cachedCdmEntity;
index 642437932235f9d4f987ab512fa5b1265708dfd7..a1e430cb623e1b66f4626767f352adbbc6ad6676 100644 (file)
@@ -17,12 +17,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import javassist.util.proxy.ProxyFactory;
 import net.sf.ehcache.Cache;
 import net.sf.ehcache.Element;
 
 import org.apache.log4j.Logger;
-import org.hibernate.collection.spi.PersistentCollection;
 import org.hibernate.proxy.HibernateProxy;
 import org.hibernate.proxy.LazyInitializer;
 import org.springframework.util.ReflectionUtils;
@@ -40,21 +38,16 @@ public class CacheLoader {
 
     private static boolean isRecursiveEnabled = true;
 
-    private final ICdmCacher cdmCacher;
+    protected final ICdmCacher cdmCacher;
 
     private final Cache cdmlibModelCache;
 
-    private final ICdmCacher cdmServiceCacher;
 
 
     public CacheLoader(ICdmCacher cdmCacher) {
-        this(cdmCacher, null);
-    }
-
-    public CacheLoader(ICdmCacher cdmCacher, ICdmCacher cdmServiceCacher) {
         this.cdmCacher = cdmCacher;
         this.cdmlibModelCache = CdmRemoteCacheManager.getInstance().getCdmModelGetMethodsCache();
-        this.cdmServiceCacher = cdmServiceCacher;
+
     }
 
 
@@ -218,7 +211,6 @@ public class CacheLoader {
             return null;
         }
 
-
         // start by looking up the cdm entity in the cache
         CdmBase cachedCdmEntity = cdmCacher.getFromCache(cdmEntity);
 
@@ -229,7 +221,6 @@ public class CacheLoader {
             if(cachedCdmEntity == cdmEntity) {
                 return cachedCdmEntity;
             }
-
         }
 
         CdmBase loadedCdmBase;
@@ -248,32 +239,22 @@ public class CacheLoader {
     }
 
 
-    private CdmBase load(CdmBase cdmEntity) {
+    protected CdmBase load(CdmBase cdmEntity) {
         logger.info("loading object of type " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId());
 
         cdmEntity = (CdmBase)ProxyUtils.deproxy(cdmEntity);
 
-        // start by looking up the cdm entity in the cache
-        CdmBase cachedCdmEntity = cdmCacher.getFromCache(cdmEntity);
+        cdmCacher.put(cdmEntity);
+
+        return cdmCacher.getFromCache(cdmEntity);
 
-        if(cachedCdmEntity != null) {
-            // if cdm entity was found in cache then return ...
-            logger.info(" - object of type " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId() + " already exists");
-            return cachedCdmEntity;
-        } else {
-            // ... else save the entity in the cache
-            cdmCacher.put(cdmEntity);
-            logger.info(" - object of type " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId() + " put in cache");
-            return cdmEntity;
-        }
     }
 
+
     private CdmBase loadRecursive(CdmBase cdmEntity,  Set<Object> alreadyVisitedEntities, boolean update) {
 
         CdmBase cachedCdmEntity = load(cdmEntity);
-        if(cdmServiceCacher != null && cdmServiceCacher.exists(cachedCdmEntity)) {
-            return cachedCdmEntity;
-        }
+
 
         // we want to recursive through the cdmEntity (and not the cachedCdmEntity)
         // since there could be new or deleted objects in the cdmEntity sub-graph
@@ -298,13 +279,13 @@ public class CacheLoader {
                     } else {
                         logger.info("object of type " + cdmEntityInSubGraph.getClass().getName() + " with id " + cdmEntityInSubGraph.getId() + " already visited");
                     }
-
                 }
             }
         } else {
             throw new CdmClientCacheException("CdmEntity with class " + cdmEntity.getClass().getName() + " is not found in the cdmlib model cache. " +
                     "The cache may be corrupted or not in sync with the latest model version" );
         }
+
         return cachedCdmEntity;
     }
 
@@ -334,57 +315,56 @@ public class CacheLoader {
             }
             field.setAccessible(true);
             Object o = field.get(cdmEntity);
-
-            if(o != null && o instanceof HibernateProxy) {
-                LazyInitializer hli = ((HibernateProxy)o).getHibernateLazyInitializer();
-                if(!hli.isUninitialized()) {
-                    o = ((HibernateProxy) o).getHibernateLazyInitializer().getImplementation();
-                    field.set(cdmEntity, o);
-                }
-            }
-
-            if(o != null && o instanceof PersistentCollection) {
-                PersistentCollection pc = ((PersistentCollection)o);
-                if(pc.wasInitialized()) {
-                    o = ProxyUtils.getObject(pc);
-                    field.set(cdmEntity, o);
-                }
-            }
-
+            o = ProxyUtils.deproxy(o);
+            field.set(cdmEntity, o);
 
             CdmBase cdmEntityInSubGraph = null;
             if(update) {
-                // making sure that the field in cached cdm entity is always
-                // up-to-date by setting to the value of the cdm entity being loaded
-                // the only exception to this is found below
-                field.set(cachedCdmEntity, o);
-            }
-            if(o != null
-                    && !ProxyFactory.isProxyClass(o.getClass())
-                    && !(o instanceof PersistentCollection) ) {
-
+                    // if we are in update mode we have to make the field of the cached entity
+                    // up-to-date by setting it to the value of the cdm entity being loaded
+                    // NOTE : two exceptions to this are found below
+                    field.set(cachedCdmEntity, o);
 
+            }
+            if(o != null && !ProxyUtils.isProxy(o)) {
                 if(CdmBase.class.isAssignableFrom(o.getClass())) {
                     logger.info("found initialised cdm entity '" + fieldName + "' in object of type " + clazz.getName() + " with id " + cdmEntity.getId());
                     cdmEntityInSubGraph  = (CdmBase)o;
                     CdmBase cachedCdmEntityInSubGraph = cdmCacher.getFromCache(cdmEntityInSubGraph);
 
-                    // the only exception to updating the field to the latest value
-                    // is the case where the field has been already initialised, cached and
-                    // is not the same as the one in the cache, in which case we set the value
-                    // of the field to the one found in the cache
+                    Object oldCachedCdmEntityInSubGraph = field.get(cachedCdmEntity);
+                    if(ProxyUtils.isProxy(oldCachedCdmEntityInSubGraph)) {
+                        LazyInitializer hli =
+                                ((HibernateProxy)oldCachedCdmEntityInSubGraph).getHibernateLazyInitializer();
+
+                        if(cdmEntityInSubGraph.getId() == ((Integer)hli.getIdentifier()).intValue()) {
+                            // exception 1 : is the case where
+                            // the earlier value of the field in the cached entity
+                            // was a proxy with the same id then we don't need to
+                            // update it here as it will be updated on demand,
+                            // so we reset it to the earlier proxy
+                            field.set(cachedCdmEntity, oldCachedCdmEntityInSubGraph);
+                            return null;
+                        }
+                    }
+
                     if(cachedCdmEntityInSubGraph != null) {
                         if(cachedCdmEntityInSubGraph != cdmEntityInSubGraph) {
+                            // exception 2 : is the case where
+                            // the field has been already initialised, cached and
+                            // is not the same as the one in the cache, in which case we set the value
+                            // of the field to the one found in the cache
                             logger.info("setting cached + real value to '" + fieldName + "' in object of type " + clazz.getName() + " with id " + cdmEntity.getId());
                             field.set(cachedCdmEntity, cachedCdmEntityInSubGraph);
                             field.set(cdmEntity, cachedCdmEntityInSubGraph);
                         } else {
-                            // hack to stop the recursion, since the field value object in cdmEntity
+                            // since the field value object in cdmEntity
                             // is the same as the field value object in cachedCdmEntity
-                            cdmEntityInSubGraph = null;
+                            // we are sure that the its subgraph is also correctly loaded,
+                            // so we can exit the recursion
+                            return null;
                         }
                     }
-
                 } else if(o instanceof Map && !alreadyVisitedEntities.contains(o)) {
                     loadRecursive((Map)o, alreadyVisitedEntities, update);
                 } else if(o instanceof Collection && !alreadyVisitedEntities.contains(o)) {
index 2d5b705f6c31c6eba6b1ca8cca5d0edc6dd5665c..6a0a63d1d1daf33b01bc7eb10f184aa4acabac4b 100644 (file)
@@ -2,6 +2,8 @@ package eu.etaxonomy.taxeditor.remoting.cache;
 
 import java.io.File;
 import java.io.InputStream;
+import java.util.HashSet;
+import java.util.Set;
 
 import net.sf.ehcache.Cache;
 import net.sf.ehcache.CacheException;
@@ -19,6 +21,8 @@ public class CdmRemoteCacheManager {
 
        private static CdmRemoteCacheManager cdmRemoteCacheManager = null;
 
+       private final Set<CdmTransientEntityCacher> transientEntityCachers = new HashSet<CdmTransientEntityCacher>();
+
     public static final Resource CDMLIB_CACHE_MANAGER_CONFIG_RESOURCE =
             new ClassPathResource("cdmlib-ehcache.xml");
 
@@ -89,4 +93,5 @@ public class CdmRemoteCacheManager {
                }
        }
 
+
 }
index 7eea5c11a05a799fca3b2354c72cb881d5757812..4c80ad7942e35d9fb135c1047f9b39daa485335d 100644 (file)
@@ -13,7 +13,6 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
-import java.util.UUID;
 
 import net.sf.ehcache.Cache;
 import net.sf.ehcache.Element;
@@ -63,19 +62,18 @@ public class CdmTransientEntityCacher implements ICdmCacher {
         this.cacheId = cacheId;
 
         cache = new Cache(getEntityCacheConfiguration(cacheId));
-        CdmRemoteCacheManager.getInstance().getDefaultCacheManager().addCache(cache);
-
 
         this.cdmEntitySessionManager = cdmEntitySessionManager;
-        CdmBase fromCache = cdmServiceCacher.getFromCache(UUID.fromString("462a7819-8b00-4190-8313-88b5be81fad5"));
-
-        cacheLoader = new CacheLoader(this, cdmServiceCacher);
 
+        cacheLoader = new CacheLoader(this);
+    }
 
+    public CdmTransientEntityCacher(Object sessionOwner, ICdmEntitySessionManager cdmEntitySessionManager) {
+        this(generateCacheId(sessionOwner), cdmEntitySessionManager);
     }
 
-    public CdmTransientEntityCacher(Object obj, ICdmEntitySessionManager cdmEntitySessionManager) {
-        this(obj.getClass().getName() +  String.valueOf(obj.hashCode()), cdmEntitySessionManager);
+    public static String generateCacheId(Object sessionOwner) {
+        return sessionOwner.getClass().getName() +  String.valueOf(sessionOwner.hashCode());
     }
 
     /**
@@ -146,7 +144,14 @@ public class CdmTransientEntityCacher implements ICdmCacher {
             return;
         }
         CdmEntityCacheKey id = new CdmEntityCacheKey(cdmEntity);
-        getCache().put(new Element(id, cdmEntity));
+
+        cachedCdmEntity = getFromCache(id);
+        if(cachedCdmEntity == null) {
+            getCache().put(new Element(id, cdmEntity));
+            logger.info(" - object of type " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId() + " put in cache");
+            return;
+        }
+        logger.info(" - object of type " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId() + " already exists");
     }
 
 
@@ -179,7 +184,7 @@ public class CdmTransientEntityCacher implements ICdmCacher {
 
         if(cachedCdmEntity == null) {
             // ... then try the permanent cache
-            cachedCdmEntity = cdmServiceCacher.getFromCache(cdmBase);
+            cachedCdmEntity = cdmServiceCacher.getFromCache(cdmBase.getUuid());
         }
 
         return cachedCdmEntity;
@@ -214,7 +219,7 @@ public class CdmTransientEntityCacher implements ICdmCacher {
 
     public void dispose() {
         cache.dispose();
-        CdmRemoteCacheManager.getInstance().getDefaultCacheManager().removeCache(cacheId);
+
     }
 
 
index 1b1daae0207accd8fa5c5dcf1e0db19aac897d5e..7c1ba5c0cc62a19ed04a09b23c288b0e219379d3 100644 (file)
@@ -20,6 +20,7 @@ import java.util.Map;
 import java.util.Set;
 
 import net.sf.ehcache.Cache;
+import net.sf.ehcache.Element;
 
 import org.apache.log4j.Logger;
 import org.hibernate.collection.spi.PersistentCollection;
@@ -182,16 +183,14 @@ public class EntityCacherDebugResult {
     private String getCachesContainingEntity(CdmBase cdmEntity) {
         Cache defaultCache = CdmRemoteCacheManager.getInstance().getDefaultCacheManager().getCache(CdmCacher.DEFAULT_CACHE_NAME);
         String caches = "";
-        Object dce = defaultCache.get(cdmEntity.getUuid());
-        if(dce != null && dce == cdmEntity) {
-            caches = CdmCacher.DEFAULT_CACHE_NAME;
-        }
-        if(!caches.isEmpty()) {
-            caches += ", ";
+        Element dce = defaultCache.get(cdmEntity.getUuid());
+        if(dce != null && dce.getObjectValue() == cdmEntity) {
+            caches = "{DC}";
         }
+
         Object cte = cacher.getFromCache(CdmTransientEntityCacher.generateKey(cdmEntity));
         if(cte != null && cte == cdmEntity) {
-            caches += cacher.toString();
+            caches += "{TC}";
         }
         return caches;
     }
@@ -500,7 +499,7 @@ public class EntityCacherDebugResult {
 
                     label = "[" + className + "] " + fieldName + " : " + String.valueOf(((Map)object).size());
                 } else if(object instanceof CdmBase) {
-                    label = "[" + className + ",id" + ((CdmBase)object).getId() + "] " + fieldName + " : " + object.toString();
+                    label = getCachesContainingEntity((CdmBase)object) +  "[" + className + ",id" + ((CdmBase)object).getId() + "] " + fieldName + " : " + object.toString();
                 } else {
                     label = "[" + className + "] " + fieldName + " : " + object.toString();
                 }
index 4baf85d6cda215ce8d3772e73e4b3fc135c8c0ff..c6c5032284ffbb4233b394d720cfd50a44c0f9dc 100644 (file)
@@ -149,6 +149,24 @@ public class ProxyUtils {
         return o;
     }
 
+    public static boolean isProxy(Object o) {
+        if(o != null && o instanceof HibernateProxy) {
+            LazyInitializer hli = ((HibernateProxy)o).getHibernateLazyInitializer();
+            if(hli.isUninitialized()) {
+                return true;
+            }
+        }
+
+        if(o != null && o instanceof PersistentCollection) {
+            PersistentCollection pc = ((PersistentCollection)o);
+            if(!pc.wasInitialized()) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
     public static void setRoleValueInOwner(Object owner, String role, Object value) {
         if(role == null || role.isEmpty()) {
             throw new CdmRemotingException("Role cannot be null or an empty string");
index 7f6d2ec9288f631281a56d5b7645a7f80eea79a9..d2b19e9ebdd6facd362fe3090028b1d309e0f400 100644 (file)
@@ -9,6 +9,7 @@ import org.springframework.remoting.support.RemoteInvocation;
 import org.springframework.remoting.support.RemoteInvocationResult;
 import org.springframework.stereotype.Component;
 
+import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
 
 @Component
@@ -41,6 +42,11 @@ public class CdmServiceRequestExecutor extends CdmAuthenticatedHttpInvokerReques
                        if(rir.getValue() != null && !rir.hasException()) {
                            if(currentRemoteInvocation.getMethodName().equals("merge")) {
                                rir = new RemoteInvocationResult(cdmEntitySessionManager.load(rir.getValue(), true));
+                           } else if(rir.getValue() instanceof UpdateResult){
+                               UpdateResult result = (UpdateResult)rir.getValue();
+                               if(result.isOk()){
+                                   cdmEntitySessionManager.update(result.getCdmEntity(), result.getUpdatedObjects());
+                               }
                            } else {
                                rir = new RemoteInvocationResult(cdmEntitySessionManager.load(rir.getValue(), false));
                            }
index 6c2d959c6f0540287e25db7ef12d2db8566f800c..e3f6b7b4229135df5e18d8fbba05193298d17ba1 100644 (file)
@@ -53,6 +53,8 @@ public class CdmEntitySession implements ICdmEntitySession  {
 
     private final List<ICdmEntitySessionEnabled> changeObservers;
 
+    private final Set<CdmBase> newCdmEntities;
+
 
 
     public CdmEntitySession(ICdmEntitySessionEnabled sessionOwner, CdmEntitySessionManager cdmEntitySessionManager) {
@@ -60,6 +62,7 @@ public class CdmEntitySession implements ICdmEntitySession  {
         this.cdmTransientEntityCacher = new CdmTransientEntityCacher(sessionOwner, cdmEntitySessionManager);
         this.cdmEntitySessionManager = cdmEntitySessionManager;
         this.changeObservers = new ArrayList<ICdmEntitySessionEnabled>();
+        this.newCdmEntities = new HashSet<CdmBase>();
         cdmEntitySessionManager.addToOwnerSessionMap(sessionOwner, this);
     }
 
@@ -82,6 +85,15 @@ public class CdmEntitySession implements ICdmEntitySession  {
         return (T)cdmTransientEntityCacher.load(cdmBase, update);
     }
 
+    @Override
+    public <T extends CdmBase> void  update() {
+        List<T> rootEntities = getRootEntities();
+        if(rootEntities != null) {
+            for(T rootEntity : rootEntities) {
+                load(rootEntity, true);
+            }
+        }
+    }
 
     @Override
     public <T extends ICdmBase> void update(T cdmBase, Set<CdmBase> affectedObjects) {
@@ -193,7 +205,7 @@ public class CdmEntitySession implements ICdmEntitySession  {
             CdmPostDataChangeObservableListener.getDefault().unregister(observer);
         }
         changeObservers.clear();
-        cdmEntitySessionManager.dispose(sessionOwner);
+        cdmEntitySessionManager.remove(sessionOwner);
     }
 
 
@@ -305,6 +317,11 @@ public class CdmEntitySession implements ICdmEntitySession  {
         return sessionOwner.getRootEntities();
     }
 
+    public CdmTransientEntityCacher getCacher() {
+        return cdmTransientEntityCacher;
+    }
+
+
 
 
 
index a55c1badf2ac116954c872e992370f284c7bdab2..5e43249ff621356484ed7ac3d361c5c6c1806a56 100644 (file)
@@ -1,24 +1,29 @@
 // $Id$
 /**
-* Copyright (C) 2014 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.
-*/
+ * Copyright (C) 2014 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.taxeditor.session;
 
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
 import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent.EventType;
 
 /**
  * @author cmathew
@@ -27,37 +32,45 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
  */
 @Component
 public class CdmEntitySessionManager implements ICdmEntitySessionManager {
-       private static final Logger logger = Logger.getLogger(CdmEntitySessionManager.class);
+    private static final Logger logger = Logger.getLogger(CdmEntitySessionManager.class);
 
     private final Map<ICdmEntitySessionEnabled, ICdmEntitySession> ownerSessionMap =
-               new HashMap<ICdmEntitySessionEnabled, ICdmEntitySession>();
+            new HashMap<ICdmEntitySessionEnabled, ICdmEntitySession>();
 
     private final List<ICdmEntitySessionManagerObserver> sessionObservers = new ArrayList<ICdmEntitySessionManagerObserver>();
 
     private ICdmEntitySession activeSession;
 
+    @Autowired
+    private CdmServiceCacher cdmServiceCacher;
+
     @Override
-       public ICdmEntitySession newSession(ICdmEntitySessionEnabled sessionOwner, boolean setAsActive) {
-               ICdmEntitySession session = ownerSessionMap.get(sessionOwner);
-               if(session == null) {
-                       session = new CdmEntitySession(sessionOwner, this);
-                       addToOwnerSessionMap(sessionOwner, session);
+    public ICdmEntitySession newSession(ICdmEntitySessionEnabled sessionOwner, boolean setAsActive) {
+        ICdmEntitySession session = ownerSessionMap.get(sessionOwner);
+        if(session == null) {
+            session = new CdmEntitySession(sessionOwner, this);
+            addToOwnerSessionMap(sessionOwner, session);
 
-               }
+        }
 
-               if(setAsActive) {
-                       activeSession = session;
+        if(setAsActive) {
+            setActiveSession(session);
 
-               }
+        }
 
-               return session;
-       }
+        return session;
+    }
 
     @Override
     public ICdmEntitySession getActiveSession() {
         return activeSession;
     }
 
+    private void setActiveSession(ICdmEntitySession activeSession) {
+        this.activeSession = activeSession;
+        cdmServiceCacher.setActiveSession(activeSession);
+    }
+
 
     /* (non-Javadoc)
      * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#getSessions()
@@ -68,82 +81,117 @@ public class CdmEntitySessionManager implements ICdmEntitySessionManager {
     }
 
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#bind(eu.etaxonomy.taxeditor.session.ISessionEventListener)
-        */
-       @Override
-       public void bind(ICdmEntitySessionEnabled sessionOwner) {
-               if(sessionOwner == null) {
-                       activeSession = null;
-                       return;
-               }
-               ICdmEntitySession session  = ownerSessionMap.get(sessionOwner);
-               if(session == null) {
-                       session = newSession(sessionOwner,true);
-               }
-
-               activeSession = session;
-
-       }
-
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#load(T)
-        */
-       @Override
-       public <T extends Object> T load(T obj, boolean update) {
-               if(activeSession == null) {
-                       return obj;
-               } else {
-                       return activeSession.load(obj, update);
-               }
-       }
-
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#load(T)
-        */
-       @Override
-       public <T extends CdmBase> T load(T cdmBase, boolean update) {
-               if(activeSession == null) {
-                       return cdmBase;
-               }
-               return activeSession.load(cdmBase, update);
-       }
-
-
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#load(java.util.Collection)
-        */
-       @Override
-       public <T extends CdmBase> Collection<T> load(Collection<T> cdmBaseList, boolean update) {
-               if(activeSession == null) {
-                       return cdmBaseList;
-               }
-               return activeSession.load(cdmBaseList, update);
-       }
-
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#dispose(eu.etaxonomy.taxeditor.session.ISessionEventListener)
-        */
-       void dispose(ICdmEntitySessionEnabled owner) {
-               ICdmEntitySession session = ownerSessionMap.get(owner);
-               if(session == null) {
-                       logger.info("No Session connected to owner, nothing to dispose");
-                       return;
-               }
-               if(session == activeSession) {
-                   activeSession = null;
-               }
-               ownerSessionMap.remove(owner);
-               notifyObservers();
-       }
-
-        void addToOwnerSessionMap(ICdmEntitySessionEnabled owner, ICdmEntitySession session) {
-               ownerSessionMap.put(owner, session);
-       }
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#bind(eu.etaxonomy.taxeditor.session.ISessionEventListener)
+     */
+    @Override
+    public void bind(ICdmEntitySessionEnabled sessionOwner) {
+        if(sessionOwner == null) {
+            setActiveSession(null);
+            return;
+        }
+        ICdmEntitySession session  = ownerSessionMap.get(sessionOwner);
+        if(session == null) {
+            session = newSession(sessionOwner,true);
+        }
+
+        setActiveSession(session);
+
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#load(T)
+     */
+    @Override
+    public <T extends Object> T load(T obj, boolean update) {
+        if(activeSession == null) {
+            return obj;
+        } else {
+            return activeSession.load(obj, update);
+        }
+    }
+
+    @Override
+    public <T extends CdmBase> void update(T cdmBase, Set<CdmBase> affectedObjects) {
+        if(activeSession != null) {
+            activeSession.addEvent(cdmBase, affectedObjects, EventType.UPDATE);
+        }
+    }
+
+    @Override
+    public <T extends CdmBase> void update() {
+        if(activeSession != null) {
+            activeSession.update();
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#load(T)
+     */
+    @Override
+    public <T extends CdmBase> T load(T cdmBase, boolean update) {
+        if(activeSession == null) {
+            return cdmBase;
+        }
+        return activeSession.load(cdmBase, update);
+    }
+
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#load(java.util.Collection)
+     */
+    @Override
+    public <T extends CdmBase> Collection<T> load(Collection<T> cdmBaseList, boolean update) {
+        if(activeSession == null) {
+            return cdmBaseList;
+        }
+        return activeSession.load(cdmBaseList, update);
+    }
+
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#dispose(eu.etaxonomy.taxeditor.session.ISessionEventListener)
+     */
+    void remove(ICdmEntitySessionEnabled owner) {
+        ICdmEntitySession session = ownerSessionMap.get(owner);
+        if(session == null) {
+            logger.info("No Session connected to owner, nothing to do");
+            return;
+        }
+        if(session == activeSession) {
+            setActiveSession(null);
+        }
+        ownerSessionMap.remove(owner);
+
+    }
+
+    @Override
+    public void dispose(ICdmEntitySessionEnabled owner) {
+        ICdmEntitySession session = ownerSessionMap.get(owner);
+        if(session != null) {
+            session.dispose();
+        }
+        notifyObservers();
+    }
+
+    @Override
+    public void disposeAll() {
+        Set<ICdmEntitySessionEnabled> owners =
+                new HashSet<ICdmEntitySessionEnabled>(ownerSessionMap.keySet());
+        for(ICdmEntitySessionEnabled owner : owners) {
+            ICdmEntitySession session = ownerSessionMap.get(owner);
+            if(session != null) {
+                session.dispose();
+            }
+        }
+        notifyObservers();
+    }
+
+    void addToOwnerSessionMap(ICdmEntitySessionEnabled owner, ICdmEntitySession session) {
+        ownerSessionMap.put(owner, session);
+    }
 
     /* (non-Javadoc)
      * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#addSessionListener()
@@ -169,9 +217,5 @@ public class CdmEntitySessionManager implements ICdmEntitySessionManager {
     }
 
 
-
-
-
-
-
 }
+
index 5fdf22b3572e73742fe1b5f221daec61de00a0b2..1b8c63a6f273e8ff9313cabde9ca2b0d951740fe 100644 (file)
@@ -55,8 +55,6 @@ public interface ICdmEntitySession {
     public <T extends CdmBase> T remoteUpdate(IService<T> service, T cdmBase);
 
 
-
-
     /**
      * @param cdmBase
      * @param affectedObjects
@@ -88,6 +86,11 @@ public interface ICdmEntitySession {
      */
     public <T extends ICdmBase> void update(T cdmBase, CdmBase affectedObject);
 
+    /**
+     *
+     */
+    public <T extends CdmBase> void update();
+
 
 
 
index e82af5ee7709895f43223f4454291229aedc23b2..e8f2157e883b7f468c0e0a40b360ecdaf9def7c9 100644 (file)
@@ -1,6 +1,7 @@
 package eu.etaxonomy.taxeditor.session;
 
 import java.util.Collection;
+import java.util.Set;
 
 import eu.etaxonomy.cdm.model.common.CdmBase;
 
@@ -29,25 +30,31 @@ public interface ICdmEntitySessionManager {
 
     public void addSessionObserver(ICdmEntitySessionManagerObserver sessionObserver);
 
-       //FIXME:Remoting would be nice to have these methods working,
-       //      but they can only be useful if we can 'intelligently'
-       //      get from a model class to the correspoding service class
 
-//     @SuppressWarnings("unchecked")
-//     public abstract <T extends CdmBase> void addRootEntity(T cdmBase);
-//
-//     @SuppressWarnings("unchecked")
-//     public abstract <T extends Object> void addRootEntities(
-//                     Collection<T> cdmBaseList);
-
-//     public abstract void commit();
-//
-//     public abstract void commit(ISessionEventListener sessionOwner);
-//
-//     public abstract void commit(IService service, CdmBase cdmBase);
 
 
     public boolean isRemoting();
 
+    /**
+     * @param owner
+     */
+    public void dispose(ICdmEntitySessionEnabled owner);
+
+    /**
+     *
+     */
+    public void disposeAll();
+
+    /**
+     * @param cdmBase
+     * @param affectedObjects
+     */
+    public <T extends CdmBase> void update(T cdmBase, Set<CdmBase> affectedObjects);
+
+    /**
+     *
+     */
+    public <T extends CdmBase> void update();
+
 
 }
\ No newline at end of file
index 5a18a3a02a964eabd234fe1496c06ccfcdf00aa4..369a82c0e5b79f06f1bec431e05a447274cb739e 100644 (file)
@@ -253,5 +253,14 @@ public class MockCdmEntitySession implements ICdmEntitySession  {
 
     }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#update()
+     */
+    @Override
+    public <T extends CdmBase> void update() {
+        // TODO Auto-generated method stub
+
+    }
+
 
 }
index beaf661dbbf6c54c19fb9a2c60aa017faebcf20f..58438a0037054b546950fc7fc6e1c9a330c1dc70 100644 (file)
@@ -1,6 +1,7 @@
 package eu.etaxonomy.taxeditor.session.mock;
 
 import java.util.Collection;
+import java.util.Set;
 
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
@@ -73,5 +74,40 @@ public class MockCdmEntitySessionManager implements ICdmEntitySessionManager {
         return false;
     }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#dispose(eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled)
+     */
+    @Override
+    public void dispose(ICdmEntitySessionEnabled owner) {
+
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#disposeAll()
+     */
+    @Override
+    public void disposeAll() {
+
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#update(eu.etaxonomy.cdm.model.common.CdmBase, java.util.Set)
+     */
+    @Override
+    public <T extends CdmBase> void update(T cdmBase, Set<CdmBase> affectedObjects) {
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager#update()
+     */
+    @Override
+    public <T extends CdmBase> void update() {
+        // TODO Auto-generated method stub
+
+    }
+
 
 }
index 91fe7089c35702daa3e3bd114a57227d82f44a0b..4efa1d39acb4a356dc567fe05f622ce383c4734d 100644 (file)
@@ -17,7 +17,7 @@
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
@@ -31,7 +31,7 @@
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
@@ -45,7 +45,7 @@
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
@@ -59,7 +59,7 @@
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
@@ -73,7 +73,7 @@
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r
     </property>\r
     <property name="httpInvokerRequestExecutor">\r
       <bean\r
-        class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" />\r
+        class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
     </property>\r
   </bean>\r
 \r