if pre- and post- install and launch commands are set for EmptySoftwareProcess, 
run them


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/52366755
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/52366755
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/52366755

Branch: refs/heads/master
Commit: 5236675560765a18c0117647e4545f5180fd4e3a
Parents: 776ad43
Author: Alex Heneveld <alex.henev...@cloudsoftcorp.com>
Authored: Thu May 21 08:46:01 2015 +0100
Committer: Alex Heneveld <alex.henev...@cloudsoftcorp.com>
Committed: Thu May 21 08:46:37 2015 +0100

----------------------------------------------------------------------
 .../basic/EmptySoftwareProcessSshDriver.java    | 32 +++++++++-----------
 1 file changed, 15 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/52366755/software/base/src/main/java/brooklyn/entity/basic/EmptySoftwareProcessSshDriver.java
----------------------------------------------------------------------
diff --git 
a/software/base/src/main/java/brooklyn/entity/basic/EmptySoftwareProcessSshDriver.java
 
b/software/base/src/main/java/brooklyn/entity/basic/EmptySoftwareProcessSshDriver.java
index 5c320c3..f7d1d3d 100644
--- 
a/software/base/src/main/java/brooklyn/entity/basic/EmptySoftwareProcessSshDriver.java
+++ 
b/software/base/src/main/java/brooklyn/entity/basic/EmptySoftwareProcessSshDriver.java
@@ -18,6 +18,7 @@
  */
 package brooklyn.entity.basic;
 
+import java.util.Map;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import brooklyn.location.basic.SshMachineLocation;
@@ -43,25 +44,22 @@ public class EmptySoftwareProcessSshDriver extends 
AbstractSoftwareProcessSshDri
     public void customize() { }
 
     @Override
-    public void setup() { }
-
-    @Override
-    public void copyInstallResources() { }
-
-    @Override
-    public void copyRuntimeResources() { }
-
-    @Override
-    public void runPreInstallCommand(String command) { }
-
-    @Override
-    public void runPostInstallCommand(String command) { }
-
-    @Override
-    public void runPreLaunchCommand(String command) { }
+    public void copyInstallResources() { 
+        Map<String, String> installFiles = 
entity.getConfig(SoftwareProcess.INSTALL_FILES);
+        Map<String, String> installTemplates = 
entity.getConfig(SoftwareProcess.INSTALL_TEMPLATES);
+        if ((installFiles!=null && !installFiles.isEmpty()) || 
(installTemplates!=null && !installTemplates.isEmpty())) {
+            super.copyInstallResources();
+        }
+    }
 
     @Override
-    public void runPostLaunchCommand(String command) { }
+    public void copyRuntimeResources() { 
+        Map<String, String> runtimeFiles = 
entity.getConfig(SoftwareProcess.RUNTIME_FILES);
+        Map<String, String> runtimeTemplates = 
entity.getConfig(SoftwareProcess.RUNTIME_TEMPLATES);
+        if ((runtimeFiles!=null && !runtimeFiles.isEmpty()) || 
(runtimeTemplates!=null && !runtimeTemplates.isEmpty())) {
+            super.copyRuntimeResources();
+        }        
+    }
 
     @Override
     public void launch() {

Reply via email to