Title: [1035] trunk/servicemix-common/src/main/java/org/servicemix/common/xbean/AbstractXBeanDeployer.java: Allow subclasses to override the main xbean file
Revision
1035
Author
gnt
Date
2005-12-07 09:20:22 -0500 (Wed, 07 Dec 2005)

Log Message

Allow subclasses to override the main xbean file

Modified Paths


Diff

Modified: trunk/servicemix-common/src/main/java/org/servicemix/common/xbean/AbstractXBeanDeployer.java (1034 => 1035)

--- trunk/servicemix-common/src/main/java/org/servicemix/common/xbean/AbstractXBeanDeployer.java	2005-12-07 13:37:13 UTC (rev 1034)
+++ trunk/servicemix-common/src/main/java/org/servicemix/common/xbean/AbstractXBeanDeployer.java	2005-12-07 14:20:22 UTC (rev 1035)
@@ -38,17 +38,19 @@
 
 public class AbstractXBeanDeployer extends AbstractDeployer {
 
-    public static final String XBEAN_FILE = "xbean.xml";
-    
     public AbstractXBeanDeployer(BaseComponent component) {
         super(component);
     }
+    
+    protected String getXBeanFile() {
+        return "xbean";
+    }
 
     /* (non-Javadoc)
      * @see org.servicemix.common.Deployer#canDeploy(java.lang.String, java.lang.String)
      */
     public boolean canDeploy(String serviceUnitName, String serviceUnitRootPath) {
-        File xbean = new File(serviceUnitRootPath, XBEAN_FILE);
+        File xbean = new File(serviceUnitRootPath, getXBeanFile() + ".xml");
         if (logger.isDebugEnabled()) {
             logger.debug("Looking for " + xbean + ": " + xbean.exists());
         }
@@ -75,7 +77,7 @@
             springLoader.setKernel(kernel);
             springLoader.setBaseDir(new File(serviceUnitRootPath));
             springLoader.setXmlPreprocessors(xmlPreprocessors);
-            ServiceName configurationName = springLoader.load("xbean");
+            ServiceName configurationName = springLoader.load(getXBeanFile());
             kernel.startService(configurationName);
             // Retrieve endpoints
             List services = getServices(kernel);

Reply via email to