brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From geom...@apache.org
Subject [11/12] brooklyn-server git commit: Make sure that the right management context is passed to the BundleMaker
Date Mon, 27 Mar 2017 10:35:30 GMT
Make sure that the right management context is passed to the BundleMaker


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

Branch: refs/heads/master
Commit: 2e91b99fce7c2e4f3227d4a2bf4b4f7bf7052e10
Parents: 99bf769
Author: Thomas Bouron <thomas.bouron@cloudsoftcorp.com>
Authored: Mon Mar 27 10:52:14 2017 +0100
Committer: Thomas Bouron <thomas.bouron@cloudsoftcorp.com>
Committed: Mon Mar 27 10:55:12 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/brooklyn/util/core/osgi/BundleMaker.java    | 4 ++--
 .../org/apache/brooklyn/rest/resources/CatalogResource.java     | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/2e91b99f/core/src/main/java/org/apache/brooklyn/util/core/osgi/BundleMaker.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/util/core/osgi/BundleMaker.java b/core/src/main/java/org/apache/brooklyn/util/core/osgi/BundleMaker.java
index 1cdcff8..35135a0 100644
--- a/core/src/main/java/org/apache/brooklyn/util/core/osgi/BundleMaker.java
+++ b/core/src/main/java/org/apache/brooklyn/util/core/osgi/BundleMaker.java
@@ -36,7 +36,7 @@ import java.util.zip.ZipOutputStream;
 import javax.annotation.Nonnull;
 
 import org.apache.brooklyn.api.mgmt.ManagementContext;
-import org.apache.brooklyn.core.mgmt.internal.LocalManagementContext;
+import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
 import org.apache.brooklyn.util.collections.MutableMap;
 import org.apache.brooklyn.util.collections.MutableSet;
 import org.apache.brooklyn.util.core.ResourceUtils;
@@ -73,7 +73,7 @@ public class BundleMaker {
     }
     
     public BundleMaker(@Nonnull ManagementContext mgmt) {
-        this( ((LocalManagementContext)mgmt).getOsgiManager().get().getFramework(), ResourceUtils.create()
);
+        this(((ManagementContextInternal) mgmt).getOsgiManager().get().getFramework(), ResourceUtils.create());
     }
 
     /** if set, this will be used to resolve relative classpath fragments;

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/2e91b99f/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java
b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java
index e00cad8..ed4885f 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java
@@ -50,7 +50,6 @@ import org.apache.brooklyn.api.typereg.RegisteredType;
 import org.apache.brooklyn.core.BrooklynFeatureEnablement;
 import org.apache.brooklyn.core.catalog.CatalogPredicates;
 import org.apache.brooklyn.core.catalog.internal.BasicBrooklynCatalog;
-import org.apache.brooklyn.core.catalog.internal.CatalogBomScanner;
 import org.apache.brooklyn.core.catalog.internal.CatalogBundleLoader;
 import org.apache.brooklyn.core.catalog.internal.CatalogDto;
 import org.apache.brooklyn.core.catalog.internal.CatalogItemComparator;
@@ -184,7 +183,7 @@ public class CatalogResource extends AbstractBrooklynRestResource implements
Cat
                 Entitlements.getEntitlementContext().user());
         }
 
-        BundleMaker bm = new BundleMaker(mgmt());
+        BundleMaker bm = new BundleMaker(mgmtInternal());
         File f=null, f2=null;
         try {
             f = Os.newTempFile("brooklyn-posted-archive", "zip");
@@ -248,6 +247,8 @@ public class CatalogResource extends AbstractBrooklynRestResource implements
Cat
                 // if the above feature is not enabled, let's do it manually (as a contract
of this method)
                 try {
                     // TODO improve on this - it ignores the configuration of whitelists,
see CatalogBomScanner.
+                    // One way would be to add the CatalogBomScanner to the new Scratchpad
area, then retrieving the singleton
+                    // here to get back the predicate from it.
                     final Predicate<Bundle> applicationsPermitted = Predicates.<Bundle>alwaysTrue();
 
                     new CatalogBundleLoader(applicationsPermitted, mgmt()).scanForCatalog(bundle);


Mime
View raw message