* @param listeners
* @return
*/
- public static CdmApplicationRemoteController NewInstance(Resource applicationContextResource,
- ICdmRemoteSource remoteSource,
- boolean omitTermLoading,
- IProgressMonitor progressMonitor,
- List<ApplicationListener> listeners) {
- return new CdmApplicationRemoteController(applicationContextResource,
- remoteSource,
- omitTermLoading,
- progressMonitor,
- listeners);
-
- }
+// public static CdmApplicationRemoteController NewInstance(Resource applicationContextResource,
+// ICdmRemoteSource remoteSource,
+// IProgressMonitor progressMonitor,
+// List<ApplicationListener> listeners) {
+// return new CdmApplicationRemoteController(applicationContextResource,
+// remoteSource,
+// false,
+// progressMonitor,
+// listeners);
+//
+// }
/**
* Creates new instance of CdmApplicationRemoteController
*
* @return
*/
public static CdmApplicationRemoteController NewInstance(ICdmRemoteSource remoteSource,
- boolean omitTermLoading,
IProgressMonitor progressMonitor,
List<ApplicationListener> listeners) {
return new CdmApplicationRemoteController(DEFAULT_REMOTE_APPLICATION_CONTEXT_RESOURCE,
remoteSource,
- omitTermLoading,
+ false,
+ progressMonitor,
+ listeners);
+
+ }
+
+ public static CdmApplicationRemoteController NewInstance(ICdmRemoteSource remoteSource,
+ boolean validateXml,
+ IProgressMonitor progressMonitor,
+ List<ApplicationListener> listeners) {
+
+ return new CdmApplicationRemoteController(DEFAULT_REMOTE_APPLICATION_CONTEXT_RESOURCE,
+ remoteSource,
+ validateXml,
progressMonitor,
listeners);
*/
private CdmApplicationRemoteController(Resource applicationContextResource,
ICdmRemoteSource remoteSource,
- boolean omitTermLoading,
+ boolean validateXml,
IProgressMonitor progressMonitor,
List<ApplicationListener> listeners){
logger.info("Start CdmApplicationRemoteController with remote source: " + remoteSource.getName());
this.applicationContextResource =
applicationContextResource != null ? applicationContextResource : DEFAULT_REMOTE_APPLICATION_CONTEXT_RESOURCE;
this.progressMonitor = progressMonitor != null ? progressMonitor : new NullProgressMonitor();
-
- setNewRemoteSource(remoteSource, omitTermLoading, listeners);
+ setNewRemoteSource(remoteSource, validateXml, listeners);
}
* @param listeners
* @return
*/
- protected boolean setNewRemoteSource(ICdmRemoteSource remoteSource,
- boolean omitTermLoading,
+ public boolean setNewRemoteSource(ICdmRemoteSource remoteSource,
+ boolean validateXml,
List<ApplicationListener> listeners){
logger.info("Connecting to '" + remoteSource.getName() + "'");
- GenericApplicationContext applicationContext
- = generateApplicationContext(remoteSource, applicationContextResource, listeners, progressMonitor, false);
-
-
-
- //progressMonitor.beginTask("Connecting to '" + remoteSource.getName() + "'", nTasks);
- applicationContext.refresh();
- applicationContext.start();
-
-
- progressMonitor.subTask("Cleaning up.");
- setApplicationContext(applicationContext);
- progressMonitor.worked(1);
+ GenericApplicationContext applicationContext = new GenericApplicationContext();
- progressMonitor.done();
- return true;
- }
-
- public static GenericApplicationContext generateApplicationContext(ICdmRemoteSource remoteSource,
- Resource applicationContextResource,
- List<ApplicationListener> listeners,
- IProgressMonitor progressMonitor,
- boolean validateXml) {
- RemotingMonitoredGenericApplicationContext applicationContext = new RemotingMonitoredGenericApplicationContext();
- int refreshTasks = 45;
- int nTasks = 5 + refreshTasks;
+ int nTasks = 5;
- progressMonitor.subTask("Registering remote source.");
- applicationContext.getEnvironment().setActiveProfiles("remoting");
- progressMonitor.worked(1);
+ progressMonitor.beginTask("Connecting to '" + remoteSource.getName() + "'", nTasks);
+ progressMonitor.subTask("Loading context beans ...");
PropertySourcesPlaceholderConfigurer pspc = new PropertySourcesPlaceholderConfigurer();
Properties properties = new Properties();
properties.setProperty("remoteServer", remoteSource.getServer());
properties.setProperty("remoteContext", remoteSource.getContextPath());
pspc.setProperties(properties);
applicationContext.addBeanFactoryPostProcessor(pspc);
-
+ applicationContext.getEnvironment().setActiveProfiles("remoting");
XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(applicationContext);
if(!validateXml) {
- xmlReader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_NONE);
+ xmlReader.setValidating(false);
}
- progressMonitor.subTask("Registering resources.");
xmlReader.loadBeanDefinitions(applicationContextResource);
- progressMonitor.worked(1);
-
if (listeners != null){
for(ApplicationListener listener : listeners){
applicationContext.addApplicationListener(listener);
}
}
+ progressMonitor.worked(1);
- return applicationContext;
+ progressMonitor.subTask("Refreshing / Starting context ...");
+ applicationContext.refresh();
+ applicationContext.start();
+ progressMonitor.worked(1);
+
+ progressMonitor.subTask("Cleaning up ...");
+ setApplicationContext(applicationContext);
+ progressMonitor.worked(1);
+
+ return true;
}
+
+
/* (non-Javadoc)
* @see eu.etaxonomy.cdm.api.application.CdmApplicationController#init()
*/
@Override
protected void init(){
+ progressMonitor.subTask("Loading configuration ...");
configuration = (ICdmApplicationConfiguration)applicationContext.getBean("cdmApplicationRemoteConfiguration");
AbstractLazyInitializer.setConfiguration((CdmApplicationRemoteConfiguration)configuration);
AbstractPersistentCollection.setConfiguration((CdmApplicationRemoteConfiguration)configuration);
+ progressMonitor.worked(1);
+ progressMonitor.subTask("Loading CDM config cache ...");
CdmModelCacher cmdmc = new CdmModelCacher();
cmdmc.cacheGetterFields();
+ progressMonitor.worked(1);
+ progressMonitor.done();
}
public ICdmEntitySessionManager getCdmEntitySessionManager() {
+++ /dev/null
-// $Id$\r
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.cdm.api.application;\r
-\r
-import java.io.Serializable;\r
-\r
-import org.apache.log4j.Logger;\r
-import org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver;\r
-import org.springframework.beans.factory.support.DefaultListableBeanFactory;\r
-import org.springframework.context.support.GenericApplicationContext;\r
-import org.springframework.core.LocalVariableTableParameterNameDiscoverer;\r
-\r
-/**\r
- * {@link GenericApplicationContext Generic application context} which allows progress monitoring.\r
- * @author a.mueller\r
- * @date 29.09.2011\r
- *\r
- */\r
-public class RemotingMonitoredGenericApplicationContext extends GenericApplicationContext implements Serializable {\r
- @SuppressWarnings("unused")\r
- private static final Logger logger = Logger.getLogger(RemotingMonitoredGenericApplicationContext.class);\r
-\r
- final int countInvokeBeanFactoryPostProcessors = 10;\r
- final int countFinishBeanFactoryInitialization = 90;\r
- private final int countTasks = countInvokeBeanFactoryPostProcessors + countFinishBeanFactoryInitialization;\r
- // private IProgressMonitor currentMonitor;\r
-\r
-\r
-\r
- /**\r
- * Constructor.\r
- * @param progressMonitor\r
- */\r
-// public RemotingMonitoredGenericApplicationContext() {\r
-//// MonitoredListableBeanFactory beanFactory =\r
-// super(new RemotingMonitoredListableBeanFactory());\r
-// //taken from empty constructor of GenericApplicationContext\r
-// ((RemotingMonitoredListableBeanFactory)getBeanFactory()).setSerializationId(getId());\r
-// ((RemotingMonitoredListableBeanFactory)getBeanFactory()).setParameterNameDiscoverer(new LocalVariableTableParameterNameDiscoverer());\r
-// ((RemotingMonitoredListableBeanFactory)getBeanFactory()).setAutowireCandidateResolver(new QualifierAnnotationAutowireCandidateResolver());\r
-// }\r
-\r
- public RemotingMonitoredGenericApplicationContext() {\r
-// MonitoredListableBeanFactory beanFactory =\r
- super();\r
- //taken from empty constructor of GenericApplicationContext\r
- ((DefaultListableBeanFactory)getBeanFactory()).setSerializationId(getId());\r
- ((DefaultListableBeanFactory)getBeanFactory()).setParameterNameDiscoverer(new LocalVariableTableParameterNameDiscoverer());\r
- ((DefaultListableBeanFactory)getBeanFactory()).setAutowireCandidateResolver(new QualifierAnnotationAutowireCandidateResolver());\r
- }\r
-\r
-\r
-// public int countTasks(){\r
-// return countTasks;\r
-// }\r
-//\r
-// @Override\r
-// protected void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory){\r
-// String task = "Invoke bean factory post processors";\r
-//// checkMonitorCancelled(currentMonitor);\r
-//// currentMonitor.subTask(task);\r
-// super.invokeBeanFactoryPostProcessors(beanFactory);\r
-//// currentMonitor.worked(countInvokeBeanFactoryPostProcessors);\r
-//// checkMonitorCancelled(currentMonitor);\r
-// }\r
-//\r
-// @Override\r
-// protected void finishBeanFactoryInitialization(ConfigurableListableBeanFactory beanFactory){\r
-//// checkMonitorCancelled(currentMonitor);\r
-// String task = "Finish bean factory initialization";\r
-//// currentMonitor.subTask(task);\r
-//// IProgressMonitor subMonitor = new SubProgressMonitor(currentMonitor, countFinishBeanFactoryInitialization);\r
-//// getMyBeanFactory().setCurrentMonitor(subMonitor);\r
-// super.finishBeanFactoryInitialization(beanFactory);\r
-//// checkMonitorCancelled(currentMonitor);\r
-//\r
-// }\r
-\r
-// /**\r
-// * @param progressMonitor the progressMonitor to set\r
-// */\r
-// public void setCurrentMonitor(IProgressMonitor monitor) {\r
-//// this.currentMonitor = monitor;\r
-// }\r
-//\r
-// /**\r
-// *\r
-// */\r
-// public IProgressMonitor getCurrentMonitor() {\r
-//// return currentMonitor;\r
-// return null;\r
-// }\r
-\r
-\r
-// /* (non-Javadoc)\r
-// * @see org.springframework.context.support.AbstractApplicationContext#refresh()\r
-// */\r
-// @Override\r
-// public void refresh() throws BeansException, IllegalStateException {\r
-// //checkMonitorCancelled(monitor);\r
-// String message = "Refresh application context. This might take a while ...";\r
-//// currentMonitor = monitor;\r
-// beginTask(message, countTasks);\r
-// super.refresh();\r
-// taskDone();\r
-// //checkMonitorCancelled(monitor);\r
-// }\r
-\r
-\r
- /**\r
- *\r
- */\r
-// private void taskDone() {\r
-//// if (currentMonitor != null){\r
-//// currentMonitor.done();\r
-//// }\r
-// }\r
-\r
-\r
-// /**\r
-// * @param monitor\r
-// * @param message\r
-// */\r
-// private void beginTask(String message, int countTasks) {\r
-//// if (currentMonitor != null){\r
-//// currentMonitor.beginTask(message, countTasks);\r
-//// }\r
-// }\r
-\r
-\r
-// private RemotingMonitoredListableBeanFactory getMyBeanFactory(){\r
-// return (RemotingMonitoredListableBeanFactory)getBeanFactory();\r
-// }\r
-//\r
-//\r
-// private void checkMonitorCancelled(IProgressMonitor monitor) {\r
-// if (monitor != null && monitor.isCanceled()){\r
-// throw new CancellationException();\r
-// }\r
-// }\r
-}\r
+++ /dev/null
-// $Id$\r
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.cdm.api.application;\r
-\r
-import java.util.Arrays;\r
-import java.util.HashSet;\r
-import java.util.List;\r
-import java.util.Set;\r
-import java.util.concurrent.CancellationException;\r
-\r
-import org.apache.log4j.Logger;\r
-import org.springframework.beans.BeansException;\r
-import org.springframework.beans.factory.support.DefaultListableBeanFactory;\r
-import org.springframework.beans.factory.support.RootBeanDefinition;\r
-\r
-import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;\r
-\r
-/**\r
- * @author a.mueller\r
- * @date 29.09.2011\r
- *\r
- */\r
-public class RemotingMonitoredListableBeanFactory extends DefaultListableBeanFactory {\r
- @SuppressWarnings("unused")\r
- private static final Logger logger = Logger.getLogger(RemotingMonitoredListableBeanFactory.class);\r
-\r
- private boolean isInitializingBeans = false;\r
- private IProgressMonitor currentMonitor;\r
-\r
- private static List<String> beansToMonitor = Arrays.asList("sessionFactory","defaultBeanInitializer","persistentTermInitializer");\r
- private final Set<String> alreadyMonitoredBeans = new HashSet<String>();\r
-\r
- public RemotingMonitoredListableBeanFactory(){\r
- }\r
-\r
-// @Override\r
-// protected RootBeanDefinition getMergedLocalBeanDefinition(String beanName) throws BeansException {\r
-// if (registeredBeanNames.contains(beanName)){\r
-// return super.getMergedLocalBeanDefinition(beanName);\r
-//\r
-// }\r
-//// String message = "Handle bean '%s'";\r
-//// message = String.format(message, beanName);\r
-//// currentMonitor.subTask(message);\r
-// RootBeanDefinition result = super.getMergedLocalBeanDefinition(beanName);\r
-//// currentMonitor.worked(1);\r
-//// registeredBeanNames.add(beanName);\r
-// return result;\r
-// }\r
-\r
- @Override\r
- public void preInstantiateSingletons() throws BeansException {\r
- isInitializingBeans = true;\r
- checkMonitorCancelled(currentMonitor);\r
- int countBeans = 0;\r
- for (String beanName : getBeanDefinitionNames()) {\r
- RootBeanDefinition bd = getMergedLocalBeanDefinition(beanName);\r
- if (!bd.isAbstract() && bd.isSingleton() && !bd.isLazyInit() && beansToMonitor.contains(beanName) ){\r
- countBeans++;\r
- }\r
- }\r
- String message = "preinstantiate singletons";\r
- currentMonitor.beginTask(message, countBeans);\r
- super.preInstantiateSingletons();\r
- isInitializingBeans = false;\r
- currentMonitor.done();\r
- }\r
-\r
-// protected <T> T doGetBean(final String name, final Class<T> requiredType, final Object[] args, boolean typeCheckOnly){\r
-// boolean doMonitor = isInitializingBeans && !monitoredBeanNames.contains(name);\r
-// if (doMonitor){\r
-// String message = "Handle bean '%s'";\r
-// message = String.format(message, name);\r
-// currentMonitor.subTask(message);\r
-// monitoredBeanNames.add(name);\r
-// }\r
-// T result = super.doGetBean(name, requiredType, args, typeCheckOnly);\r
-// if (doMonitor){\r
-// currentMonitor.worked(1);\r
-// }\r
-// return result;\r
-// }\r
-\r
- @Override\r
- protected Object createBean(final String name, final RootBeanDefinition mbd, final Object[] args){\r
- boolean doMonitor = isInitializingBeans && beansToMonitor.contains(name) && !alreadyMonitoredBeans.contains(name);\r
- checkMonitorCancelled(currentMonitor);\r
- if (doMonitor){\r
- String message;\r
- if (name.equals("sessionFactory")){\r
- message = "Initializing persistence context ...";\r
- }else if(name.equals("persistentTermInitializer")){\r
- message = "Loading terms ...";\r
- }else{\r
- message = "Handling '%s'";\r
- message = String.format(message, name);\r
- }\r
- currentMonitor.subTask(message);\r
- alreadyMonitoredBeans.add(name);\r
- }\r
- Object result = super.createBean(name, mbd, args);\r
- if (doMonitor){\r
- checkMonitorCancelled(currentMonitor);\r
- currentMonitor.worked(1);\r
- }\r
- return result;\r
- }\r
-\r
-\r
- /**\r
- * @param mainMonitor the mainMonitor to set\r
- */\r
- public void setCurrentMonitor(IProgressMonitor monitor) {\r
- this.currentMonitor = monitor;\r
- }\r
-\r
- private void checkMonitorCancelled(IProgressMonitor monitor) {\r
- if (monitor != null && monitor.isCanceled()){\r
- throw new CancellationException();\r
- }\r
- }\r
-\r
-}\r
private final List<CdmModelFieldPropertyFromClass> cmgmfcList = new ArrayList<CdmModelFieldPropertyFromClass>();
- public void cacheGetters() {
-
- Configuration configuration = new Configuration().configure("/eu/etaxonomy/cdm/mappings/hibernate.cfg.xml");
- configuration.buildMappings();
- Iterator<PersistentClass> classMappingIterator = configuration.getClassMappings();
-
- Cache cache = CdmRemoteCacheManager.getInstance().getCdmModelGetMethodsCache();
- cache.removeAll();
-
- while(classMappingIterator.hasNext()) {
- PersistentClass persistentClass = classMappingIterator.next();
- Class mappedClass = persistentClass.getMappedClass();
- String mappedClassName = mappedClass.getName();
-
- CdmModelFieldPropertyFromClass cmgmfc = new CdmModelFieldPropertyFromClass(mappedClassName);
- Iterator propertyIt = persistentClass.getPropertyIterator();
-
- logger.info("Adding class : " + mappedClassName + " to cache");
-
- while(propertyIt.hasNext())
- {
- Property property = (Property)propertyIt.next();
- Getter getter = property.getGetter(mappedClass);
- if(getter != null && getter.getMember() != null) {
- Field field = (Field)getter.getMember();
- String getMethod = getMethodNameFromFieldName(field.getName(), field.getType().getName());
- logger.info(" - getMethod : " + getMethod + " for type " + field.getType().getName());
- cmgmfc.addGetMethods(getMethod);
- }
- }
- cache.put(new Element(mappedClassName, cmgmfc));
-
- }
- cache.flush();
- }
public void cacheGetterFields() {
cache.put(new Element(mappedClassName, cmgmfc));
}
- cache.flush();
+ //cache.flush();
}
private void addGetters(PersistentClass persistentClass, CdmModelFieldPropertyFromClass cmgmfc) {
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;
import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.config.CacheConfiguration;
+import net.sf.ehcache.config.SizeOfPolicyConfiguration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
-import eu.etaxonomy.cdm.common.CdmUtils;
-
public class CdmRemoteCacheManager {
public static final Resource CDMLIB_CACHE_MANAGER_CONFIG_RESOURCE =
new ClassPathResource("cdmlib-ehcache.xml");
+ public static final String CDM_MODEL_CACHE_MGR_NAME = "cdmlibModelCacheManager";
public static final String CDM_MODEL_CACHE_NAME = "cdmModelGetMethodsCache";
}
private CdmRemoteCacheManager() {
- System.setProperty("ehcache.disk.store.dir", CdmUtils.getCdmHomeDir().getAbsolutePath() + File.separator + "cdmlib-model");
+
try {
// NOTE:Programmatically creating the cache manager may solve the problem of
// recreating data written to disk on startup
// see https://stackoverflow.com/questions/1729605/ehcache-persist-to-disk-issues
//String cacheFilePath = CDMLIB_CACHE_MANAGER_CONFIG_RESOURCE.getFile().getAbsolutePath();
InputStream in = this.getClass().getClassLoader().getResourceAsStream("cdmlib-ehcache.xml");
- cdmlibModelCacheManager = new CacheManager(in);
+
+ SizeOfPolicyConfiguration sizeOfConfig = new SizeOfPolicyConfiguration();
+ sizeOfConfig.setMaxDepth(1000);
+ sizeOfConfig.setMaxDepthExceededBehavior("abort");
+
+ CacheConfiguration modelcc = new CacheConfiguration(CDM_MODEL_CACHE_NAME, 0)
+ .eternal(true)
+ .statistics(true)
+ .sizeOfPolicy(sizeOfConfig)
+ .overflowToOffHeap(false);
+
+ Cache modelCache = new Cache(modelcc);
+
+ cdmlibModelCacheManager = CacheManager.create(CDM_MODEL_CACHE_MGR_NAME);
+ cdmlibModelCacheManager.addCache(modelCache);
} catch (CacheException e) {
throw new CdmClientCacheException(e);
}
-// } catch (IOException e) {
-// throw new CdmClientCacheException(e);
-// }
+
}
public Cache getCdmModelGetMethodsCache(){
}
}
- public static void checkCacheProperties() {
- String pathToCache = System.getProperty("ehcache.disk.store.dir");
- if(pathToCache == null || pathToCache.isEmpty()) {
- throw new CdmClientCacheException("'ehcache.disk.store.dir' property is not set");
- }
- }
}
--- /dev/null
+// $Id$
+/**
+* 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.taxeditor.util;
+
+import org.hibernate.cfg.Configuration;
+
+/**
+ * @author cmathew
+ * @date 27 May 2015
+ *
+ */
+public class Serializer {
+
+ String HB_CONFIG_PATH= "/eu/etaxonomy/cdm/mappings/hibernate.cfg.xml";
+
+ public static void serializeHbConfig(String serializedFilePath) {
+ Configuration configuration = new Configuration().configure("/eu/etaxonomy/cdm/mappings/hibernate.cfg.xml");
+ configuration.buildMappings();
+ }
+
+}
<beans xmlns="http://www.springframework.org/schema/beans"\r
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"\r
xmlns:tx="http://www.springframework.org/schema/tx"\r
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd\r
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">\r
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd\r
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd\r
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd"\r
+ default-lazy-init="true">\r
\r
\r
- <bean id="agentService" \r
+ <bean id="agentService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/agent.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="annotationService"\r
+ <bean id="annotationService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/annotation.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="auditeventService"\r
+ <bean id="auditeventService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/auditevent.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="classificationService"\r
+ <bean id="classificationService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/classification.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="collectionService"\r
+ <bean id="collectionService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/collection.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="commonService"\r
+ <bean id="commonService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/common.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="descriptionService"\r
+ <bean id="descriptionService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/description.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="editGeoService"\r
+ <bean id="editGeoService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/editgeo.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="featureNodeService"\r
+ <bean id="featureNodeService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/featurenode.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="featureTreeService"\r
+ <bean id="featureTreeService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/featuretree.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="groupService"\r
+ <bean id="groupService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/group.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="identificationKeyService"\r
+ <bean id="identificationKeyService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/identificationkey.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="locationService"\r
+ <bean id="locationService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/location.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="markerService"\r
+ <bean id="markerService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/marker.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="mediaService"\r
+ <bean id="mediaService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/media.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="nameService"\r
+ <bean id="nameService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/name.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="occurrenceService"\r
+ <bean id="occurrenceService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/occurrence.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="polytomousKeyNodeService"\r
+ <bean id="polytomousKeyNodeService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/polytomouskeynode.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="polytomousKeyService"\r
+ <bean id="polytomousKeyService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/polytomouskey.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="referenceService"\r
+ <bean id="referenceService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/reference.service</value>\r
</property> <property name="serviceInterface"> <value>eu.etaxonomy.cdm.api.service.IService</value> \r
</property> </bean> -->\r
\r
- <bean id="taxonNodeService"\r
+ <bean id="taxonNodeService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/taxonnode.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="taxonService"\r
+ <bean id="taxonService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/taxon.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="termService"\r
+ <bean id="termService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/term.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="userService"\r
+ <bean id="userService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting-public/user.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="vocabularyService"\r
+ <bean id="vocabularyService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/vocabulary.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="workingSetService"\r
+ <bean id="workingSetService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/workingset.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="grantedAuthorityService"\r
+ <bean id="grantedAuthorityService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/grantedauthority.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="databaseService"\r
+ <bean id="databaseService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting-public/database.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="lsidAuthorityService"\r
+ <bean id="lsidAuthorityService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/lsidauthoruty.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="lsidMetadataService"\r
+ <bean id="lsidMetadataService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/lsidmetadata.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="lsiDataService"\r
+ <bean id="lsiDataService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/lsiddata.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="authenticationManager"\r
- class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
- <property name="serviceUrl">\r
- <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/authenticationManager.service</value>\r
- </property>\r
- <property name="serviceInterface">\r
- <value>org.springframework.security.authentication.AuthenticationManager\r
- </value>\r
- </property>\r
- <property name="httpInvokerRequestExecutor">\r
- <bean\r
- class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
- </property>\r
- </bean>\r
+<!-- <bean id="providerManager" -->\r
+<!-- class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean"> -->\r
+<!-- <property name="serviceUrl"> -->\r
+<!-- <value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/authenticationManager.service</value> -->\r
+<!-- </property> -->\r
+<!-- <property name="serviceInterface"> -->\r
+<!-- <value>org.springframework.security.authentication.AuthenticationManager -->\r
+<!-- </value> -->\r
+<!-- </property> -->\r
+<!-- <property name="httpInvokerRequestExecutor"> -->\r
+<!-- <bean -->\r
+<!-- class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" /> -->\r
+<!-- </property> -->\r
+<!-- </bean> -->\r
\r
- <bean id="primerService"\r
+ <bean id="primerService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/primer.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="amplificationService"\r
+ <bean id="amplificationService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/amplification.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="sequenceService"\r
+ <bean id="sequenceService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/sequence.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="entityValidationService"\r
+ <bean id="entityValidationService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/entityvalidation.service</value>\r
</property>\r
</bean>\r
\r
- <bean id="entityConstraintViolationService"\r
+ <bean id="entityConstraintViolationService" lazy-init="true"\r
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">\r
<property name="serviceUrl">\r
<value>http://${remoteServer}:${remotePort}/${remoteContext}/remoting/entityconstraintviolation.service</value>\r
<beans xmlns="http://www.springframework.org/schema/beans"\r
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"\r
xmlns:tx="http://www.springframework.org/schema/tx"\r
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">\r
-\r
-\r
- <!-- <bean id="remoteTermInitializer" class="eu.etaxonomy.cdm.remote.service.RemoteTermInitializer"/> -->\r
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">\r
\r
<context:annotation-config />\r
\r
<import resource="classpath:/eu/etaxonomy/cdm/httpInvokerServiceClients.xml" />\r
\r
-\r
-\r
- <!-- <context:component-scan base-package="eu/etaxonomy/taxeditor/session" \r
- /> -->\r
- <bean id="cdmEntitySessionManager" class="eu.etaxonomy.taxeditor.session.CdmEntitySessionManager" />\r
+ <bean id="cdmEntitySessionManager" \r
+ class="eu.etaxonomy.taxeditor.session.CdmEntitySessionManager" />\r
\r
<bean id="cdmApplicationRemoteConfiguration" \r
class="eu.etaxonomy.cdm.api.application.CdmApplicationRemoteConfiguration" />\r
\r
- <!-- <import resource="classpath:/eu/etaxonomy/cdm/remoting_services_security.xml" \r
- /> -->\r
-\r
-<!-- <context:component-scan base-package="eu.etaxonomy.taxeditor.service" /> -->\r
\r
- <bean id="cdmServiceRequestExecutor"\r
+ <bean id="cdmServiceRequestExecutor" \r
class="eu.etaxonomy.taxeditor.service.CdmServiceRequestExecutor" />\r
\r
<bean id="cachedCommonService" \r
class="eu.etaxonomy.taxeditor.service.CachedCommonServiceImpl" />\r
\r
<bean id="accessDecisionManager" \r
- class="eu.etaxonomy.cdm.persistence.hibernate.permission.UnanimousBasedUnrevokable">\r
+ class="eu.etaxonomy.cdm.persistence.hibernate.permission.UnanimousBasedUnrevokable" >\r
\r
<property name="decisionVoters">\r
<list>\r
\r
<!-- CdmPermissionEvaluator.hasPermissions() evaluates the CdmPermissions \r
like TAXONNODE.UPDATE{20c8f083-5870-4cbd-bf56-c5b2b98ab6a7} -->\r
- <bean id="cdmPermissionEvaluator"\r
+ <bean id="cdmPermissionEvaluator" \r
class="eu.etaxonomy.cdm.persistence.hibernate.permission.CdmPermissionEvaluator">\r
<property name="accessDecisionManager" ref="accessDecisionManager" />\r
</bean>\r
<!-- The CdmSecurityHibernateInterceptor checks onSave() and on flushDirty() \r
if the currently authenticated principal or token has sufficient permissions \r
on the entity to be persisted -->\r
- <bean id="securityHibernateInterceptor"\r
+ <bean id="securityHibernateInterceptor" \r
class="eu.etaxonomy.cdm.persistence.hibernate.CdmSecurityHibernateInterceptor">\r
<property name="permissionEvaluator" ref="cdmPermissionEvaluator" />\r
</bean>\r
\r
-<!-- <bean id="authenticationManager" -->\r
-<!-- class="org.springframework.security.authentication.ProviderManager"> -->\r
-<!-- <property name="providers"> -->\r
-<!-- <list> -->\r
-<!-- <ref local="daoAuthenticationProvider" /> -->\r
-<!-- </list> -->\r
-<!-- </property> -->\r
-<!-- </bean> -->\r
-\r
-<!-- <bean id="daoAuthenticationProvider" -->\r
-<!-- class="org.springframework.security.authentication.dao.DaoAuthenticationProvider"> -->\r
-<!-- <property name="userDetailsService" ref="userService" /> -->\r
-<!-- <property name="saltSource" ref="saltSource" /> -->\r
-<!-- <property name="passwordEncoder" ref="passwordEncoder" /> -->\r
-<!-- </bean> -->\r
-\r
-<!-- <bean id="passwordEncoder" -->\r
-<!-- class="org.springframework.security.authentication.encoding.Md5PasswordEncoder" /> -->\r
+ <bean id="authenticationManager"\r
+ class="org.springframework.security.authentication.ProviderManager">\r
+ <property name="providers">\r
+ <list>\r
+ <ref local="daoAuthenticationProvider" />\r
+ </list>\r
+ </property>\r
+ </bean>\r
\r
-<!-- <bean id="saltSource" -->\r
-<!-- class="org.springframework.security.authentication.dao.ReflectionSaltSource"> -->\r
-<!-- <property name="userPropertyToUse" value="getUsername" /> -->\r
-<!-- </bean> -->\r
+ <bean id="daoAuthenticationProvider" \r
+ class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">\r
+ <property name="userDetailsService" ref="userService" />\r
+ <property name="saltSource" ref="saltSource" />\r
+ <property name="passwordEncoder" ref="passwordEncoder" />\r
+ </bean>\r
\r
+ <bean id="passwordEncoder" \r
+ class="org.springframework.security.authentication.encoding.Md5PasswordEncoder" />\r
\r
- <context:component-scan base-package="eu.etaxonomy.cdm.api.cache">\r
- <!-- FIXME:Remoting Temp workaround to make remoting work -->\r
- <context:exclude-filter type="regex"\r
- expression="eu\.etaxonomy\.cdm\.api\.cache\.CdmTermCacher" />\r
- </context:component-scan>\r
+ <bean id="saltSource" \r
+ class="org.springframework.security.authentication.dao.ReflectionSaltSource">\r
+ <property name="userPropertyToUse" value="getUsername" />\r
+ </bean>\r
\r
\r
+ <bean id="cdmServiceCacher" \r
+ class="eu.etaxonomy.cdm.api.cache.CdmServiceCacher" />\r
\r
\r
</beans>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"\r
- xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"\r
- xsi:schemaLocation="http://www.springframework.org/schema/beans\r
- http://www.springframework.org/schema/beans/spring-beans-3.2.xsd\r
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd\r
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd\r
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd\r
- ">\r
-\r
-\r
- <!--\r
- ============================== SECURITY ==============================\r
- -->\r
- <bean id="accessDecisionManager" class="eu.etaxonomy.cdm.persistence.hibernate.permission.UnanimousBasedUnrevokable">\r
- <property name="decisionVoters">\r
- <list>\r
- <bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.GrantAlwaysVoter" />\r
- <bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.TaxonNodeVoter" />\r
- <bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.TaxonBaseVoter" />\r
- <bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.DescriptionBaseVoter" />\r
- <bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.DescriptionElementVoter" />\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <!--\r
- CdmPermissionEvaluator.hasPermissions() evaluates the CdmPermissions like TAXONNODE.UPDATE{20c8f083-5870-4cbd-bf56-c5b2b98ab6a7}\r
- -->\r
- <bean id="cdmPermissionEvaluator" class="eu.etaxonomy.cdm.persistence.hibernate.permission.CdmPermissionEvaluator">\r
- <property name="accessDecisionManager" ref="accessDecisionManager" />\r
- </bean>\r
-\r
- <!-- The CdmSecurityHibernateInterceptor checks onSave() and on flushDirty() if the currently authenticated principal or token has\r
- sufficient permissions on the entity to be persisted -->\r
- <bean id="securityHibernateInterceptor" class="eu.etaxonomy.cdm.persistence.hibernate.CdmSecurityHibernateInterceptor">\r
- <property name="permissionEvaluator" ref="cdmPermissionEvaluator" />\r
- </bean>\r
-\r
-</beans>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xmlns:context="http://www.springframework.org/schema/context"\r
- xmlns:security="http://www.springframework.org/schema/security"\r
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd\r
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd\r
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd\r
- http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"\r
- >\r
-\r
- <import resource="classpath:/eu/etaxonomy/cdm/remoting_persistence_security.xml"/>\r
- <!--\r
- ======================================================================\r
- security specific configuration\r
- ======================================================================\r
- -->\r
-<!-- <security:global-method-security pre-post-annotations="enabled" run-as-manager-ref="runAsManager" > -->\r
-<!-- <security:expression-handler ref="expressionHandler" /> -->\r
-<!-- </security:global-method-security> -->\r
-\r
- <!--\r
- To use "hasPermission()" in the Spring EL method annotations like @PreAuthorize we explicitly configure the permissionEvaluator\r
- the cdmPermissionEvaluator is already defined in the persistence security context\r
- -->\r
-<!-- <bean id="expressionHandler" class="org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler"> -->\r
-<!-- <property name="permissionEvaluator" ref="cdmPermissionEvaluator" /> -->\r
-<!-- </bean> -->\r
-\r
- <bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">\r
- <property name="providers">\r
- <list>\r
- <ref local="daoAuthenticationProvider"/>\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="daoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">\r
- <property name="userDetailsService" ref="userService"/>\r
- <property name="saltSource" ref="saltSource"/>\r
- <property name="passwordEncoder" ref="passwordEncoder"/>\r
- </bean>\r
-\r
- <bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.Md5PasswordEncoder"/>\r
-\r
- <bean id="saltSource" class="org.springframework.security.authentication.dao.ReflectionSaltSource">\r
- <property name="userPropertyToUse" value="getUsername"/>\r
- </bean>\r
-\r
- <!--\r
- Run-As Authentication Replacement for system operations\r
- as e.g. performed by the eu.etaxonomy.cdm.api.application.FirstDataInserter\r
-\r
- the key must match FirstDataInserter.RUN_AS_KEY\r
- -->\r
-<!-- <bean id="runAsManager" -->\r
-<!-- class="org.springframework.security.access.intercept.RunAsManagerImpl"> -->\r
-<!-- <property name="key" value="TtlCx3pgKC4l"/> -->\r
-<!-- </bean> -->\r
-\r
-\r
-</beans>\r
import java.util.Collection;
-import org.springframework.security.authentication.ProviderManager;
+import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionStatus;
* @see eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration#getAuthenticationManager()
*/
@Override
- public ProviderManager getAuthenticationManager() {
+ public AuthenticationManager getAuthenticationManager() {
return defaultApplicationConfiguration.getAuthenticationManager();
}
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.security.access.PermissionEvaluator;
-import org.springframework.security.authentication.ProviderManager;
+import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
private static SearchManager searchManager = new SearchManager();
private static EditorManager editorManager = new EditorManager();
-
- private static UseObjectStore useObjectInitializer = new UseObjectStore();
+
+ private static UseObjectStore useObjectInitializer = new UseObjectStore();
private static CdmStoreConnector job;
return service;
}
-
+
/**
* @see #getService(Class)
* As ICommonService is not extending IService we need a specific request here
* {@link org.springframework.security.authentication.ProviderManager}
* object.
*/
- public static ProviderManager getAuthenticationManager() {
+ public static AuthenticationManager getAuthenticationManager() {
return getCurrentApplicationConfiguration().getAuthenticationManager();
}
subprogressMonitor);
} else if(cdmSource instanceof ICdmRemoteSource) {
return CdmApplicationRemoteController.NewInstance((ICdmRemoteSource)cdmSource,
- false,
subprogressMonitor,
null);
} else {
// $Id$
/**
-* 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.
-*/
+ * 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.taxeditor.application;
+import org.junit.Test;
+import org.unitils.UnitilsJUnit4;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
+import eu.etaxonomy.cdm.common.monitor.NullProgressMonitor;
+import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
+import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSource;
+
/**
* @author cmathew
* @date 26 May 2015
*
*/
-public class CdmApplicationRemoteControllerTest {
-
-
+public class CdmApplicationRemoteControllerTest extends UnitilsJUnit4 {
+ @Test
+ public void initApplicationControllerTest() {
+ CdmRemoteSource crs = CdmRemoteSource.NewInstance("local-cyprus",
+ "localhost",
+ 8080,
+ "",
+ NomenclaturalCode.ICNAFP);
+ // first initialize with validation to make sure the xml is valid
+ CdmApplicationRemoteController.NewInstance(crs,
+ true,
+ new NullProgressMonitor(),
+ null);
+ }
}
import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSourceException;
import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource;
import eu.etaxonomy.taxeditor.session.CdmEntitySession;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
/**
cdmRemoteSource = CdmRemoteSource.NewInstance(sourceName, host, port, contextPath, ncode);
remoteApplicationController =
CdmApplicationRemoteController.NewInstance(cdmRemoteSource,
- false,
null,
null);