logger.info("Connecting to '" + remoteSource.getName() + "'");
GenericApplicationContext applicationContext
- = generateApplicationContext(applicationContextResource, listeners, progressMonitor, false);
+ = generateApplicationContext(remoteSource, applicationContextResource, listeners, progressMonitor, false);
+
- PropertySourcesPlaceholderConfigurer pspc = new PropertySourcesPlaceholderConfigurer();
- Properties properties = new Properties();
- properties.setProperty("remoteServer", remoteSource.getServer());
- properties.setProperty("remotePort", String.valueOf(remoteSource.getPort()));
- properties.setProperty("remoteContext", remoteSource.getContextPath());
- pspc.setProperties(properties);
- applicationContext.addBeanFactoryPostProcessor(pspc);
//progressMonitor.beginTask("Connecting to '" + remoteSource.getName() + "'", nTasks);
applicationContext.refresh();
applicationContext.start();
return true;
}
- public static GenericApplicationContext generateApplicationContext(Resource applicationContextResource,
+ public static GenericApplicationContext generateApplicationContext(ICdmRemoteSource remoteSource,
+ Resource applicationContextResource,
List<ApplicationListener> listeners,
IProgressMonitor progressMonitor,
boolean validateXml) {
applicationContext.getEnvironment().setActiveProfiles("remoting");
progressMonitor.worked(1);
+ PropertySourcesPlaceholderConfigurer pspc = new PropertySourcesPlaceholderConfigurer();
+ Properties properties = new Properties();
+ properties.setProperty("remoteServer", remoteSource.getServer());
+ properties.setProperty("remotePort", String.valueOf(remoteSource.getPort()));
+ properties.setProperty("remoteContext", remoteSource.getContextPath());
+ pspc.setProperties(properties);
+ applicationContext.addBeanFactoryPostProcessor(pspc);
+
XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(applicationContext);
if(!validateXml) {
xmlReader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_NONE);