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:07 GMT
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/645#discussion_r113707914
  
    --- Diff: core/src/main/java/org/apache/brooklyn/core/mgmt/persist/BrooklynMementoPersisterToObjectStore.java
---
    @@ -658,6 +701,33 @@ private Stopwatch deltaImpl(Delta delta, PersistenceExceptionHandler
exceptionHa
             }
         }
     
    +    private void addPersistContentIfManagedBundle(final BrooklynObjectType type, final
String id, List<ListenableFuture<?>> futures, final PersistenceExceptionHandler
exceptionHandler) {
    +        if (type==BrooklynObjectType.MANAGED_BUNDLE) {
    +            if (mgmt==null) {
    +                throw new IllegalStateException("Cannot persist bundles without a mangaement
context");
    +            }
    +            final ManagedBundle mb = ((ManagementContextInternal)mgmt).getOsgiManager().get().getManagedBundles().get(id);
    +            if (mb==null) {
    +                LOG.warn("Cannot find managed bundle for added bundle "+id+"; ignoring");
    +                return;
    +            }
    +            
    +            if (mb instanceof BasicManagedBundle) {
    +                final File f = ((BasicManagedBundle)mb).getTempLocalFileWhenJustUploaded();
    --- End diff --
    
    added an extra check to bail out in the executor.  the executor is single-threaded so
that is fine.  (just synching wouldn't guarantee it doesn't submit multiple times i don't
htink.)


---
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