brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From geomacy <>
Subject [GitHub] brooklyn-server pull request: Add application white/bl...
Date Wed, 13 Apr 2016 14:58:52 GMT
Github user geomacy commented on a diff in the pull request:
    --- Diff: core/src/main/java/org/apache/brooklyn/core/catalog/internal/
    @@ -155,9 +181,42 @@ public void removedBundle(Bundle bundle, BundleEvent bundleEvent,
Iterable<? ext
                     LOG.debug("No BOM found in {} {} {}", bundleIds(bundle));
    +            if (!passesWhiteAndBlacklists(bundle)) {
    +                removeAnyApplications(catalogItems);
    +            }
                 return catalogItems;
    +        private void removeAnyApplications(Iterable<? extends CatalogItem<?, ?>>
catalogItems) {
    +            final Iterator<? extends CatalogItem<?, ?>> cit = catalogItems.iterator();
    +            while (cit.hasNext()) {
    +                final CatalogItem<?, ?> item =;
    +                if (TEMPLATE.equals(item.getCatalogItemType())) {
    +                    removeFromCatalog(item);
    +                    cit.remove();
    --- End diff --
    This method modifies its argument, which is ultimately used as a return value for addingBundle,
which becomes the set of items that is tracked by the BundleTracker, so if I remove something
from the catalog in here, I also need to remove it from the iterable.  This probably this
isn't clear enough from the code as written, so I shall change this to return a new Iterable
rather than modify the arg.

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 or file a JIRA ticket
with INFRA.

View raw message