X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Fimpl%2Fosgi%2FExtensibleBundleTracker.java;h=62215d6626f833f95e47bd4e9066567a3cd91f75;hp=a0d9122ac6f121e2110455e9cf196103c8ddc245;hb=refs%2Fchanges%2F73%2F46573%2F5;hpb=660c3e22ca97bc613ea6f6288503620bba6fb233 diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ExtensibleBundleTracker.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ExtensibleBundleTracker.java index a0d9122ac6..62215d6626 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ExtensibleBundleTracker.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/ExtensibleBundleTracker.java @@ -8,7 +8,6 @@ package org.opendaylight.controller.config.manager.impl.osgi; import com.google.common.util.concurrent.ThreadFactoryBuilder; -import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; @@ -74,27 +73,18 @@ public final class ExtensibleBundleTracker extends BundleTracker> { @Override public Future addingBundle(final Bundle bundle, final BundleEvent event) { LOG.trace("Submiting AddingBundle for bundle {} and event {} to be processed asynchronously",bundle,event); - Future future = eventExecutor.submit(new Callable() { - @Override - public T call() throws Exception { - try { - T primaryTrackerRetVal = primaryTracker.addingBundle(bundle, event); + return eventExecutor.submit(() -> { + try { + T primaryTrackerRetVal = primaryTracker.addingBundle(bundle, event); - forEachAdditionalBundle(new BundleStrategy() { - @Override - public void execute(final BundleTrackerCustomizer tracker) { - tracker.addingBundle(bundle, event); - } - }); - LOG.trace("AddingBundle for {} and event {} finished successfully",bundle,event); - return primaryTrackerRetVal; - } catch (Exception e) { - LOG.error("Failed to add bundle {}", bundle, e); - throw e; - } + forEachAdditionalBundle(tracker -> tracker.addingBundle(bundle, event)); + LOG.trace("AddingBundle for {} and event {} finished successfully",bundle,event); + return primaryTrackerRetVal; + } catch (Exception e) { + LOG.error("Failed to add bundle {}", bundle, e); + throw e; } }); - return future; } @Override @@ -114,12 +104,7 @@ public final class ExtensibleBundleTracker extends BundleTracker> { try { LOG.trace("Invoking removedBundle event for {}",bundle); primaryTracker.removedBundle(bundle, event, object.get()); - forEachAdditionalBundle(new BundleStrategy() { - @Override - public void execute(final BundleTrackerCustomizer tracker) { - tracker.removedBundle(bundle, event, null); - } - }); + forEachAdditionalBundle(tracker -> tracker.removedBundle(bundle, event, null)); LOG.trace("Removed bundle event for {} finished successfully.",bundle); } catch (Exception e) { LOG.error("Failed to remove bundle {}", bundle, e);