brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahgittin <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #645: Persist OSGi bundles
Date Thu, 27 Apr 2017 14:21:41 GMT
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<Object> rawSerializer = new XmlMementoSerializer<Object>(mgmt.getClass().getClassLoader());
             RetryingMementoSerializer<Object> serializer = new RetryingMementoSerializer<Object>(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.
---

Mime
View raw message