You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2017/11/22 01:01:32 UTC
[1/2] brooklyn-server git commit: Delete bundle: handle pre-installed
karaf bundles
Repository: brooklyn-server
Updated Branches:
refs/heads/master 24ba999e3 -> f77b9f084
Delete bundle: handle pre-installed karaf bundles
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/08d23746
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/08d23746
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/08d23746
Branch: refs/heads/master
Commit: 08d237466eff048c650ebb6b830ce5b1e2dffbcf
Parents: 96c3411
Author: Aled Sage <al...@gmail.com>
Authored: Tue Nov 21 15:29:50 2017 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Tue Nov 21 15:35:42 2017 +0000
----------------------------------------------------------------------
.../brooklyn/core/mgmt/ha/OsgiManager.java | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/08d23746/core/src/main/java/org/apache/brooklyn/core/mgmt/ha/OsgiManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/ha/OsgiManager.java b/core/src/main/java/org/apache/brooklyn/core/mgmt/ha/OsgiManager.java
index 34b974a..db0c6b7 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/ha/OsgiManager.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/ha/OsgiManager.java
@@ -472,17 +472,17 @@ public class OsgiManager {
}
if (!leaveInOsgi) {
- Bundle bundle = framework.getBundleContext().getBundle(bundleMetadata.getOsgiUniqueUrl());
- result.bundle = bundle;
- if (bundle==null) {
+ Maybe<Bundle> bundle = findBundle(bundleMetadata);
+ result.bundle = bundle.orNull();
+ if (bundle.isAbsent()) {
Exception e = new IllegalStateException("No such bundle installed in OSGi when uninstalling: "+bundleMetadata);
if (!force) Exceptions.propagate(e);
log.warn(e.getMessage());
errors.add(e);
} else {
try {
- bundle.stop();
- bundle.uninstall();
+ bundle.get().stop();
+ bundle.get().uninstall();
} catch (BundleException e) {
Exceptions.propagateIfFatal(e);
if (!force) Exceptions.propagate(e);
@@ -686,6 +686,16 @@ public class OsgiManager {
}
}
+ protected Maybe<Bundle> findBundle(ManagedBundle managedBundle) {
+ if (managedBundle.getOsgiUniqueUrl() != null) {
+ Bundle bundle = framework.getBundleContext().getBundle(managedBundle.getOsgiUniqueUrl());
+ if (bundle != null) {
+ return Maybe.of(bundle);
+ }
+ }
+ return findBundle((OsgiBundleWithUrl)managedBundle);
+ }
+
public Maybe<Bundle> findBundle(OsgiBundleWithUrl catalogBundle) {
// Prefer OSGi Location as URL or the managed bundle recorded URL,
// not bothering to check name:version if supplied here (eg to forgive snapshot version discrepancies);
[2/2] brooklyn-server git commit: This closes #903
Posted by he...@apache.org.
This closes #903
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/f77b9f08
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/f77b9f08
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/f77b9f08
Branch: refs/heads/master
Commit: f77b9f084b981935eb128492bf93bf85502f5275
Parents: 24ba999 08d2374
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Wed Nov 22 01:01:19 2017 +0000
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Wed Nov 22 01:01:19 2017 +0000
----------------------------------------------------------------------
.../brooklyn/core/mgmt/ha/OsgiManager.java | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------