Removed BundleContext from Broker.register{Consumer,Provider} (Part 2) 14/9314/1
authorEd Warnicke <eaw@cisco.com>
Fri, 25 Jul 2014 12:05:21 +0000 (07:05 -0500)
committerEd Warnicke <eaw@cisco.com>
Fri, 25 Jul 2014 12:05:21 +0000 (07:05 -0500)
Moved the bodies of the methods around to make the deprecated
methods just call throughs to the new methods.

Removed extra argument from private method newSessionFor

Change-Id: I748662491e6670262ecfad4122bcc7a9f831107d
Signed-off-by: Ed Warnicke <eaw@cisco.com>
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.java

index c15582e..6806677 100644 (file)
@@ -62,22 +62,13 @@ public class BrokerImpl implements Broker, RpcProvisionRegistry, AutoCloseable {
     @Override
     public ConsumerSession registerConsumer(final Consumer consumer,
             final BundleContext ctx) {
-        checkPredicates(consumer);
-        log.trace("Registering consumer {}", consumer);
-        final ConsumerContextImpl session = newSessionFor(consumer, ctx);
-        consumer.onSessionInitiated(session);
-        sessions.add(session);
-        return session;
+        return registerConsumer(consumer);
     }
 
     @Override
     public ProviderSession registerProvider(final Provider provider,
             final BundleContext ctx) {
-        checkPredicates(provider);
-        final ProviderContextImpl session = newSessionFor(provider, ctx);
-        provider.onSessionInitiated(session);
-        providerSessions.add(session);
-        return session;
+        return registerProvider(provider);
     }
 
     protected Future<RpcResult<CompositeNode>> invokeRpcAsync(final QName rpc,
@@ -106,14 +97,12 @@ public class BrokerImpl implements Broker, RpcProvisionRegistry, AutoCloseable {
     }
 
     // Private Factory methods
-    private ConsumerContextImpl newSessionFor(final Consumer provider,
-            final BundleContext ctx) {
+    private ConsumerContextImpl newSessionFor(final Consumer provider) {
         ConsumerContextImpl ret = new ConsumerContextImpl(provider, this);
         return ret;
     }
 
-    private ProviderContextImpl newSessionFor(final Provider provider,
-            final BundleContext ctx) {
+    private ProviderContextImpl newSessionFor(final Provider provider) {
         ProviderContextImpl ret = new ProviderContextImpl(provider, this);
         return ret;
     }
@@ -210,14 +199,23 @@ public class BrokerImpl implements Broker, RpcProvisionRegistry, AutoCloseable {
 
 
     @Override
-    public ConsumerSession registerConsumer(Consumer cons) {
-        return registerConsumer(cons,null);
+    public ConsumerSession registerConsumer(Consumer consumer) {
+        checkPredicates(consumer);
+        log.trace("Registering consumer {}", consumer);
+        final ConsumerContextImpl session = newSessionFor(consumer);
+        consumer.onSessionInitiated(session);
+        sessions.add(session);
+        return session;
     }
 
 
     @Override
-    public ProviderSession registerProvider(Provider prov) {
-        return registerProvider(prov,null);
+    public ProviderSession registerProvider(Provider provider) {
+        checkPredicates(provider);
+        final ProviderContextImpl session = newSessionFor(provider);
+        provider.onSessionInitiated(session);
+        providerSessions.add(session);
+        return session;
     }
 
 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.