+/**
+* 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.cdm.api.application;
import java.util.List;
import eu.etaxonomy.cdm.common.monitor.SubProgressMonitor;
import eu.etaxonomy.cdm.remote.ICdmRemoteSource;
+/**
+ * CDM Application Controller class for remoting clients
+ * FIXME:Remoting extending {@link CdmApplicationController} is a temporary workaround.
+ * The {@link CdmApplicationController} should be split into a CdmApplicationControllerBase
+ * class with {@link CdmApplicationController} and this class as subclasses
+ *
+ */
public class CdmApplicationRemoteController extends CdmApplicationController {
private static final Logger logger = Logger.getLogger(CdmApplicationRemoteController.class);
private final Resource applicationContextResource;
private final IProgressMonitor progressMonitor;
+ /**
+ * Creates new instance of CdmApplicationRemoteController
+ *
+ * @param applicationContextResource
+ * @param remoteSource
+ * @param omitTermLoading
+ * @param progressMonitor
+ * @param listeners
+ * @return
+ */
public static CdmApplicationRemoteController NewInstance(Resource applicationContextResource,
ICdmRemoteSource remoteSource,
boolean omitTermLoading,
}
+ /**
+ * Constructs CdmApplicationRemoteController
+ *
+ * @param applicationContextResource
+ * @param remoteSource
+ * @param omitTermLoading
+ * @param progressMonitor
+ * @param listeners
+ */
private CdmApplicationRemoteController(Resource applicationContextResource,
ICdmRemoteSource remoteSource,
boolean omitTermLoading,
}
/**
+ * Returns classpath resource for application context config file
+ *
* @return
*/
protected static ClassPathResource getClasspathResource() {
return new ClassPathResource(DEFAULT_APPLICATION_CONTEXT_RESOURCE);
}
+
+
/**
- * Sets the application context to a new spring ApplicationContext by using the according data source and initializes the Controller.
- * @param dataSource
+ * Creates and starts a new spring application context
+ *
+ * @param remoteSource object for connecting to an http-invoker server
+ * @param omitTermLoading
+ * @param listeners
+ * @return
*/
protected boolean setNewRemoteSource(ICdmRemoteSource remoteSource,
boolean omitTermLoading,
pspc.setProperties(properties);
applicationContext.addBeanFactoryPostProcessor(pspc);
progressMonitor.worked(1);
-
-// BeanDefinition remoteSourceBean = remoteSource.getRemoteSourceBean();
-// remoteSourceBean.setAttribute("isLazy", false);
-// applicationContext.registerBeanDefinition("dataSource", remoteSourceBean);
-
XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(applicationContext);
progressMonitor.subTask("Registering resources.");
return true;
}
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.application.CdmApplicationController#init()
+ */
@Override
- protected void init(){
- logger.debug("Init " + this.getClass().getName() + " ... ");
- if (logger.isDebugEnabled()){for (String beanName : applicationContext.getBeanDefinitionNames()){ logger.debug(beanName);}}
- //TODO delete next row (was just for testing)
- if (logger.isInfoEnabled()){
- logger.info("Registered Beans: ");
- String[] beanNames = applicationContext.getBeanDefinitionNames();
- for (String beanName : beanNames){
- logger.info(beanName);
- }
- }
+ protected void init(){
configuration = (ICdmApplicationConfiguration)applicationContext.getBean("cdmApplicationRemoteConfiguration");
}