servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r430404 - /incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/AbstractXBeanDeployer.java
Date Thu, 10 Aug 2006 14:51:14 GMT
Author: gnodet
Date: Thu Aug 10 07:51:13 2006
New Revision: 430404

URL: http://svn.apache.org/viewvc?rev=430404&view=rev
Log:
Allow xbean deployers to override the XmlPreProcessors and BeanFactoryPostProcessors to use

Modified:
    incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/AbstractXBeanDeployer.java

Modified: incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/AbstractXBeanDeployer.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/AbstractXBeanDeployer.java?rev=430404&r1=430403&r2=430404&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/AbstractXBeanDeployer.java
(original)
+++ incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/AbstractXBeanDeployer.java
Thu Aug 10 07:51:13 2006
@@ -71,24 +71,13 @@
             su.setRootPath(serviceUnitRootPath);
             // Load configuration
             Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
-            FileSystemRepository repository = new FileSystemRepository(new File(serviceUnitRootPath));
-            ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository);
-            List xmlPreprocessors = Collections.singletonList(classLoaderXmlPreprocessor);
+
             SpringLoader springLoader = new SpringLoader();
             springLoader.setKernel(kernel);
             springLoader.setBaseDir(new File(serviceUnitRootPath));
-            springLoader.setXmlPreprocessors(xmlPreprocessors);
+            springLoader.setXmlPreprocessors(getXmlPreProcessors(serviceUnitRootPath));
+            springLoader.setBeanFactoryPostProcessors(getBeanFactoryPostProcessors(serviceUnitRootPath));
             
-            PropertyPlaceholderConfigurer propertyPlaceholder = new PropertyPlaceholderConfigurer();
-			FileSystemResource propertiesFile = new FileSystemResource(
-					new File(serviceUnitRootPath) + "/" + getXBeanFile()
-							+ ".properties");
-			if (propertiesFile.getFile().exists()) {				
-				propertyPlaceholder.setLocation(propertiesFile);
-				springLoader.setBeanFactoryPostProcessors(Collections
-						.singletonList(propertyPlaceholder));
-			} 
-			
             ServiceName configurationName = springLoader.load(getXBeanFile());
             kernel.startService(configurationName);
             su.setConfiguration(configurationName);
@@ -132,5 +121,23 @@
     protected boolean validate(Endpoint endpoint) throws DeploymentException {
         return true;
     }
-
+    
+    protected List getXmlPreProcessors(String serviceUnitRootPath) {
+        FileSystemRepository repository = new FileSystemRepository(new File(serviceUnitRootPath));
+        ClassLoaderXmlPreprocessor classLoaderXmlPreprocessor = new ClassLoaderXmlPreprocessor(repository);
+        return Collections.singletonList(classLoaderXmlPreprocessor);
+    }
+    
+    protected List getBeanFactoryPostProcessors(String serviceUnitRootPath) {
+        PropertyPlaceholderConfigurer propertyPlaceholder = new PropertyPlaceholderConfigurer();
+        FileSystemResource propertiesFile = new FileSystemResource(
+                new File(serviceUnitRootPath) + "/" + getXBeanFile()
+                        + ".properties");
+        if (propertiesFile.getFile().exists()) {                
+            propertyPlaceholder.setLocation(propertiesFile);
+            return Collections.singletonList(propertyPlaceholder);
+        } 
+        return Collections.EMPTY_LIST;
+    }
+    
 }



Mime
View raw message