Adds WINRM_ADDRESS attribute in VanillaWindowsProcess

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

Branch: refs/heads/master
Commit: dd563f3e65f2f0785178bbd12f02aaf2c5cbbb94
Parents: d7451b4
Author: Aled Sage <[email protected]>
Authored: Sat Jun 13 17:28:48 2015 +0100
Committer: Aled Sage <[email protected]>
Committed: Sat Jun 13 23:11:10 2015 +0100

----------------------------------------------------------------------
 .../entity/basic/VanillaWindowsProcessWinRmDriver.java    | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/dd563f3e/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessWinRmDriver.java
----------------------------------------------------------------------
diff --git 
a/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessWinRmDriver.java
 
b/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessWinRmDriver.java
index db2f546..29c6e15 100644
--- 
a/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessWinRmDriver.java
+++ 
b/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessWinRmDriver.java
@@ -19,6 +19,7 @@
 package brooklyn.entity.basic;
 
 import brooklyn.location.basic.WinRmMachineLocation;
+import brooklyn.util.net.UserAndHostAndPort;
 
 public class VanillaWindowsProcessWinRmDriver extends 
AbstractSoftwareProcessWinRmDriver implements VanillaWindowsProcessDriver {
 
@@ -27,6 +28,15 @@ public class VanillaWindowsProcessWinRmDriver extends 
AbstractSoftwareProcessWin
     }
 
     @Override
+    public void start() {
+        WinRmMachineLocation machine = (WinRmMachineLocation) location;
+        UserAndHostAndPort winrmAddress = 
UserAndHostAndPort.fromParts(machine.getUser(), 
machine.getAddress().getHostName(), 
machine.config().get(WinRmMachineLocation.WINRM_PORT));
+        getEntity().setAttribute(Attributes.WINRM_ADDRESS, winrmAddress);
+
+        super.start();
+    }
+    
+    @Override
     public void preInstall() {
         super.preInstall();
         executeCommand(VanillaWindowsProcess.PRE_INSTALL_COMMAND, 
VanillaWindowsProcess.PRE_INSTALL_POWERSHELL_COMMAND, true);

Reply via email to