X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=protocol%2Fnetconf-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fimpl%2Fosgi%2FAggregatedNetconfOperationServiceFactory.java;h=30083fb4bc85fb772a43d8d31ae0a1542f77f3f1;hb=refs%2Fchanges%2F99%2F104299%2F6;hp=d1dc45124a71bcfa5745214faea9200a24cea03a;hpb=57f606aa0a3ac728737b88d42d6a2e11be5cfca6;p=netconf.git diff --git a/protocol/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/AggregatedNetconfOperationServiceFactory.java b/protocol/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/AggregatedNetconfOperationServiceFactory.java index d1dc45124a..30083fb4bc 100644 --- a/protocol/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/AggregatedNetconfOperationServiceFactory.java +++ b/protocol/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/AggregatedNetconfOperationServiceFactory.java @@ -30,7 +30,10 @@ import org.opendaylight.yangtools.concepts.Registration; /** * NetconfOperationService aggregator. Makes a collection of operation services accessible as one. */ -public final class AggregatedNetconfOperationServiceFactory +// Non-final for OSGi DS +// FIXME: split into abstract class for the multiple uses we have, which really is about which construct is being +// invoked +public class AggregatedNetconfOperationServiceFactory implements NetconfOperationServiceFactory, NetconfOperationServiceFactoryListener, AutoCloseable { private final Set factories = ConcurrentHashMap.newKeySet(); private final Multimap registrations = @@ -45,7 +48,7 @@ public final class AggregatedNetconfOperationServiceFactory } @Override - public synchronized void onAddNetconfOperationServiceFactory(final NetconfOperationServiceFactory service) { + public final synchronized void onAddNetconfOperationServiceFactory(final NetconfOperationServiceFactory service) { factories.add(service); for (final CapabilityListener listener : listeners) { @@ -54,13 +57,14 @@ public final class AggregatedNetconfOperationServiceFactory } @Override - public synchronized void onRemoveNetconfOperationServiceFactory(final NetconfOperationServiceFactory service) { + public final synchronized void onRemoveNetconfOperationServiceFactory( + final NetconfOperationServiceFactory service) { factories.remove(service); registrations.removeAll(service).forEach(Registration::close); } @Override - public Set getCapabilities() { + public final Set getCapabilities() { final Set capabilities = new HashSet<>(); for (final NetconfOperationServiceFactory factory : factories) { capabilities.addAll(factory.getCapabilities()); @@ -69,7 +73,7 @@ public final class AggregatedNetconfOperationServiceFactory } @Override - public synchronized Registration registerCapabilityListener(final CapabilityListener listener) { + public final synchronized Registration registerCapabilityListener(final CapabilityListener listener) { final Map regs = new HashMap<>(); for (final NetconfOperationServiceFactory factory : factories) { @@ -93,7 +97,7 @@ public final class AggregatedNetconfOperationServiceFactory } @Override - public synchronized NetconfOperationService createService(final String netconfSessionIdForReporting) { + public final synchronized NetconfOperationService createService(final String netconfSessionIdForReporting) { return new AggregatedNetconfOperation(factories, netconfSessionIdForReporting); }