Fix issue with name
authorMathieu Baudier <mbaudier@argeo.org>
Mon, 27 Jul 2009 13:49:03 +0000 (13:49 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Mon, 27 Jul 2009 13:49:03 +0000 (13:49 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@2779 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/lib/vbox/VBoxMachine.java

index effa3da8641def955f3c450faa96fbf6a25454d7..2b561b6a83f98fb9a870d9a09ed77b8c52eee118 100644 (file)
@@ -6,10 +6,13 @@ import org.argeo.slc.deploy.DeployedSystem;
 import org.argeo.slc.deploy.DeploymentData;
 import org.argeo.slc.deploy.TargetData;
 import org.springframework.beans.factory.BeanNameAware;
+import org.springframework.beans.factory.InitializingBean;
 
-public class VBoxMachine implements DeployedSystem, BeanNameAware {
+public class VBoxMachine implements DeployedSystem, BeanNameAware,
+               InitializingBean {
        private String deployedSystemId = null;
        private String name;
+       private String beanName;
 
        public String getDeployedSystemId() {
                return deployedSystemId;
@@ -39,8 +42,13 @@ public class VBoxMachine implements DeployedSystem, BeanNameAware {
                this.deployedSystemId = deployedSystemId;
        }
 
-       public void setBeanName(String name) {
-               this.name = name;
+       public void setBeanName(String beanName) {
+               this.beanName = name;
+       }
+
+       public void afterPropertiesSet() throws Exception {
+               if (name == null)
+                       name = beanName;
        }
 
 }