Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B1A6D200C5B for ; Thu, 27 Apr 2017 16:21:44 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B04A3160BA7; Thu, 27 Apr 2017 14:21:44 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 04EF3160B98 for ; Thu, 27 Apr 2017 16:21:43 +0200 (CEST) Received: (qmail 71349 invoked by uid 500); 27 Apr 2017 14:21:41 -0000 Mailing-List: contact dev-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 dev@brooklyn.apache.org Received: (qmail 71322 invoked by uid 99); 27 Apr 2017 14:21:41 -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; Thu, 27 Apr 2017 14:21:41 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 34946DFDAC; Thu, 27 Apr 2017 14:21:41 +0000 (UTC) From: ahgittin To: dev@brooklyn.apache.org Reply-To: dev@brooklyn.apache.org References: In-Reply-To: Subject: [GitHub] brooklyn-server pull request #645: Persist OSGi bundles Content-Type: text/plain Message-Id: <20170427142141.34946DFDAC@git1-us-west.apache.org> Date: Thu, 27 Apr 2017 14:21:41 +0000 (UTC) archived-at: Thu, 27 Apr 2017 14:21:44 -0000 Github user ahgittin commented on a diff in the pull request: https://github.com/apache/brooklyn-server/pull/645#discussion_r113708045 --- Diff: core/src/main/java/org/apache/brooklyn/core/mgmt/persist/BrooklynPersistenceUtils.java --- @@ -171,21 +173,31 @@ private static BrooklynMementoRawData newStateMementoFromLocal(ManagementContext MementoSerializer rawSerializer = new XmlMementoSerializer(mgmt.getClass().getClassLoader()); RetryingMementoSerializer serializer = new RetryingMementoSerializer(rawSerializer, 1); - result.planeId(mgmt.getOptionalManagementPlaneId().orNull()); + result.planeId(mgmt.getManagementPlaneIdMaybe().orNull()); for (Location instance: mgmt.getLocationManager().getLocations()) result.location(instance.getId(), serializer.toString(newObjectMemento(instance))); for (Entity instance: mgmt.getEntityManager().getEntities()) { instance = Entities.deproxy(instance); result.entity(instance.getId(), serializer.toString(newObjectMemento(instance))); - for (Feed instanceAdjunct: ((EntityInternal)instance).feeds().getFeeds()) + for (Feed instanceAdjunct: ((EntityInternal)instance).feeds().getFeeds()) { result.feed(instanceAdjunct.getId(), serializer.toString(newObjectMemento(instanceAdjunct))); - for (Enricher instanceAdjunct: instance.enrichers()) + } + for (Enricher instanceAdjunct: instance.enrichers()) { result.enricher(instanceAdjunct.getId(), serializer.toString(newObjectMemento(instanceAdjunct))); - for (Policy instanceAdjunct: instance.policies()) + } + for (Policy instanceAdjunct: instance.policies()) { result.policy(instanceAdjunct.getId(), serializer.toString(newObjectMemento(instanceAdjunct))); + } } - for (CatalogItem instance: mgmt.getCatalog().getCatalogItems()) + for (CatalogItem instance: mgmt.getCatalog().getCatalogItems()) { result.catalogItem(instance.getId(), serializer.toString(newObjectMemento(instance))); + } + OsgiManager osgi = ((LocalManagementContext)mgmt).getOsgiManager().orNull(); + if (osgi!=null) { + for (ManagedBundle instance: osgi.getManagedBundles().values()) { + result.catalogItem(instance.getId(), serializer.toString(newObjectMemento(instance))); --- End diff -- good spot --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---