import java.util.Properties;
import org.apache.log4j.Logger;
+import org.hibernate.collection.internal.AbstractPersistentCollection;
+import org.hibernate.proxy.AbstractLazyInitializer;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
/**
* 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
private static final Logger logger = Logger.getLogger(CdmApplicationRemoteController.class);
- public static final String DEFAULT_APPLICATION_CONTEXT_RESOURCE = "/eu/etaxonomy/cdm/remoteApplicationContext.xml";
+ public static final Resource DEFAULT_REMOTE_APPLICATION_CONTEXT_RESOURCE =
+ new ClassPathResource("/eu/etaxonomy/cdm/remotingApplicationContext.xml");
private final Resource applicationContextResource;
private final IProgressMonitor progressMonitor;
progressMonitor,
listeners);
+ }
+ /**
+ * Creates new instance of CdmApplicationRemoteController
+ *
+ * @param applicationContextResource
+ * @param remoteSource
+ * @param omitTermLoading
+ * @param progressMonitor
+ * @param listeners
+ * @return
+ */
+ public static CdmApplicationRemoteController NewInstance(ICdmRemoteSource remoteSource,
+ boolean omitTermLoading,
+ IProgressMonitor progressMonitor,
+ List<ApplicationListener> listeners) {
+
+ return new CdmApplicationRemoteController(DEFAULT_REMOTE_APPLICATION_CONTEXT_RESOURCE,
+ remoteSource,
+ omitTermLoading,
+ progressMonitor,
+ listeners);
+
}
/**
IProgressMonitor progressMonitor,
List<ApplicationListener> listeners){
logger.info("Start CdmApplicationRemoteController with remote source: " + remoteSource.getName());
- this.applicationContextResource = applicationContextResource != null ? applicationContextResource : getClasspathResource();
+ this.applicationContextResource =
+ applicationContextResource != null ? applicationContextResource : DEFAULT_REMOTE_APPLICATION_CONTEXT_RESOURCE;
this.progressMonitor = progressMonitor != null ? progressMonitor : new NullProgressMonitor();
setNewRemoteSource(remoteSource, omitTermLoading, listeners);
}
- /**
- * Returns classpath resource for application context config file
- *
- * @return
- */
- protected static ClassPathResource getClasspathResource() {
- return new ClassPathResource(DEFAULT_APPLICATION_CONTEXT_RESOURCE);
- }
+
/**
@Override
protected void init(){
configuration = (ICdmApplicationConfiguration)applicationContext.getBean("cdmApplicationRemoteConfiguration");
+ AbstractLazyInitializer.setConfiguration(this);
+ AbstractPersistentCollection.setConfiguration(this);
}