Return-Path: X-Original-To: apmail-brooklyn-commits-archive@minotaur.apache.org Delivered-To: apmail-brooklyn-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E8A2019199 for ; Wed, 30 Mar 2016 13:59:41 +0000 (UTC) Received: (qmail 5778 invoked by uid 500); 30 Mar 2016 13:59:39 -0000 Delivered-To: apmail-brooklyn-commits-archive@brooklyn.apache.org Received: (qmail 5541 invoked by uid 500); 30 Mar 2016 13:59:39 -0000 Mailing-List: contact commits-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list commits@brooklyn.apache.org Received: (qmail 5055 invoked by uid 99); 30 Mar 2016 13:59:38 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Mar 2016 13:59:38 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9453CE020D; Wed, 30 Mar 2016 13:59:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: heneveld@apache.org To: commits@brooklyn.apache.org Date: Wed, 30 Mar 2016 13:59:40 -0000 Message-Id: <258b746b682a450e8fdb8ae0da670ce2@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [03/50] brooklyn-server git commit: Replace ServiceLoader with FrameworkLookup for LocationResolver. Replace ServiceLoader with FrameworkLookup for LocationResolver. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/b60db4c6 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/b60db4c6 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/b60db4c6 Branch: refs/heads/master Commit: b60db4c6f4dd5f57e06a962d52e734f361dd7c88 Parents: 98d1b60 Author: Geoff Macartney Authored: Tue Mar 8 14:56:22 2016 +0000 Committer: Geoff Macartney Committed: Tue Mar 15 14:52:57 2016 +0000 ---------------------------------------------------------------------- .../core/location/BasicLocationRegistry.java | 4 +- .../resources/OSGI-INF/blueprint/blueprint.xml | 51 ++++++++++++++++++-- .../resources/OSGI-INF/blueprint/blueprint.xml | 38 +++++++++++++++ .../org/apache/brooklyn/cli/ItemLister.java | 4 +- .../resources/OSGI-INF/blueprint/blueprint.xml | 10 ++-- 5 files changed, 98 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/b60db4c6/core/src/main/java/org/apache/brooklyn/core/location/BasicLocationRegistry.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/brooklyn/core/location/BasicLocationRegistry.java b/core/src/main/java/org/apache/brooklyn/core/location/BasicLocationRegistry.java index 0dc88d0..51a036d 100644 --- a/core/src/main/java/org/apache/brooklyn/core/location/BasicLocationRegistry.java +++ b/core/src/main/java/org/apache/brooklyn/core/location/BasicLocationRegistry.java @@ -27,11 +27,11 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.NoSuchElementException; -import java.util.ServiceLoader; import java.util.Set; import org.apache.brooklyn.api.catalog.BrooklynCatalog; import org.apache.brooklyn.api.catalog.CatalogItem; +import org.apache.brooklyn.api.framework.FrameworkLookup; import org.apache.brooklyn.api.location.Location; import org.apache.brooklyn.api.location.LocationDefinition; import org.apache.brooklyn.api.location.LocationRegistry; @@ -152,7 +152,7 @@ public class BasicLocationRegistry implements LocationRegistry { } protected void findServices() { - ServiceLoader loader = ServiceLoader.load(LocationResolver.class, mgmt.getCatalogClassLoader()); + Iterable loader = FrameworkLookup.lookupAll(LocationResolver.class, mgmt.getCatalogClassLoader()); MutableList loadedResolvers; try { loadedResolvers = MutableList.copyOf(loader); http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/b60db4c6/core/src/main/resources/OSGI-INF/blueprint/blueprint.xml ---------------------------------------------------------------------- diff --git a/core/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/core/src/main/resources/OSGI-INF/blueprint/blueprint.xml index c28c155..227aae2 100644 --- a/core/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ b/core/src/main/resources/OSGI-INF/blueprint/blueprint.xml @@ -46,13 +46,58 @@ limitations under the License. - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/b60db4c6/locations/jclouds/src/main/resources/OSGI-INF/blueprint/blueprint.xml ---------------------------------------------------------------------- diff --git a/locations/jclouds/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/locations/jclouds/src/main/resources/OSGI-INF/blueprint/blueprint.xml new file mode 100644 index 0000000..96d964f --- /dev/null +++ b/locations/jclouds/src/main/resources/OSGI-INF/blueprint/blueprint.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/b60db4c6/server-cli/src/main/java/org/apache/brooklyn/cli/ItemLister.java ---------------------------------------------------------------------- diff --git a/server-cli/src/main/java/org/apache/brooklyn/cli/ItemLister.java b/server-cli/src/main/java/org/apache/brooklyn/cli/ItemLister.java index 7b18fa7..d7eddce 100644 --- a/server-cli/src/main/java/org/apache/brooklyn/cli/ItemLister.java +++ b/server-cli/src/main/java/org/apache/brooklyn/cli/ItemLister.java @@ -36,6 +36,7 @@ import org.apache.brooklyn.api.catalog.Catalog; import org.apache.brooklyn.api.catalog.CatalogItem; import org.apache.brooklyn.api.entity.Entity; import org.apache.brooklyn.api.entity.ImplementedBy; +import org.apache.brooklyn.api.framework.FrameworkLookup; import org.apache.brooklyn.api.location.Location; import org.apache.brooklyn.api.location.LocationResolver; import org.apache.brooklyn.api.objs.BrooklynObject; @@ -216,7 +217,8 @@ public class ItemLister { policies.addAll(ItemDescriptors.toItemDescriptors(getTypes(urls, Policy.class), headingsOnly, "name")); enrichers.addAll(ItemDescriptors.toItemDescriptors(getTypes(urls, Enricher.class), headingsOnly, "name")); locations.addAll(ItemDescriptors.toItemDescriptors(getTypes(urls, Location.class, false), headingsOnly, "type")); - locationResolvers.addAll(ItemDescriptors.toItemDescriptors(ImmutableList.copyOf(ServiceLoader.load(LocationResolver.class)), true)); + locationResolvers.addAll(ItemDescriptors.toItemDescriptors( + ImmutableList.copyOf(FrameworkLookup.lookupAll(LocationResolver.class)), true)); } if (!yamlToScan.isEmpty()) { List urls = getYamlUrls(); http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/b60db4c6/software/base/src/main/resources/OSGI-INF/blueprint/blueprint.xml ---------------------------------------------------------------------- diff --git a/software/base/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/software/base/src/main/resources/OSGI-INF/blueprint/blueprint.xml index f0d62e1..58c88a2 100644 --- a/software/base/src/main/resources/OSGI-INF/blueprint/blueprint.xml +++ b/software/base/src/main/resources/OSGI-INF/blueprint/blueprint.xml @@ -25,13 +25,17 @@ limitations under the License. - - + + + +