You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2018/01/18 09:02:52 UTC
[5/7] brooklyn-server git commit: Add mutex to copPreInstallResources
Add mutex to copPreInstallResources
Should probably do this in the same way as with copyInstallResources.
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/90c63b2c
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/90c63b2c
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/90c63b2c
Branch: refs/heads/master
Commit: 90c63b2cc018e3d6586880354de95923b999718f
Parents: bad7ec0
Author: Duncan Grant <du...@cloudsoftcorp.com>
Authored: Wed Jan 17 16:03:25 2018 +0000
Committer: Duncan Grant <du...@cloudsoftcorp.com>
Committed: Wed Jan 17 16:03:25 2018 +0000
----------------------------------------------------------------------
.../AbstractSoftwareProcessWinRmDriver.java | 21 ++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/90c63b2c/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessWinRmDriver.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessWinRmDriver.java b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessWinRmDriver.java
index 28a6b97..b7d23ea 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessWinRmDriver.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessWinRmDriver.java
@@ -171,6 +171,20 @@ public abstract class AbstractSoftwareProcessWinRmDriver extends AbstractSoftwar
}
}
+ @Override
+ public void copyPreInstallResources() {
+ final WithMutexes mutexSupport = getLocation().mutexes();
+ String mutexId = "installation lock at host";
+ mutexSupport.acquireMutex(mutexId, "pre-installing " + elvis(entity, this));
+ try {
+ super.copyPreInstallResources();
+ } catch (Exception e) {
+ LOG.warn("Error copying pre-install resources", e);
+ throw Exceptions.propagate(e);
+ } finally {
+ mutexSupport.releaseMutex(mutexId);
+ }
+ }
@Override
public void copyInstallResources() {
@@ -180,7 +194,7 @@ public abstract class AbstractSoftwareProcessWinRmDriver extends AbstractSoftwar
try {
super.copyInstallResources();
} catch (Exception e) {
-// log.warn("Error copying install resources", e);
+ LOG.warn("Error copying install resources", e);
throw Exceptions.propagate(e);
} finally {
mutexSupport.releaseMutex(mutexId);
@@ -190,13 +204,12 @@ public abstract class AbstractSoftwareProcessWinRmDriver extends AbstractSoftwar
@Override
public void copyCustomizeResources() {
final WithMutexes mutexSupport = getLocation().mutexes();
- final String description = "customizing " + elvis(entity, this);
String mutexId = "installation lock at host";
- mutexSupport.acquireMutex(mutexId, description);
+ mutexSupport.acquireMutex(mutexId, "customizing " + elvis(entity, this));
try {
super.copyCustomizeResources();
} catch (Exception e) {
-// log.warn("Error copying customize resources", e);
+ LOG.warn("Error copying customize resources", e);
throw Exceptions.propagate(e);
} finally {
mutexSupport.releaseMutex(mutexId);