Fix issues when persistence enabled
[controller.git] / opendaylight / md-sal / sal-remoterpc-connector / src / main / java / org / opendaylight / controller / config / yang / config / remote_rpc_connector / RemoteRPCBrokerModule.java
index d7843eab8a65ae058899093869f3e5e394301c95..e4631f965dbd0566a1baaa992a9ae65d779a2f72 100644 (file)
@@ -1,13 +1,16 @@
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
 package org.opendaylight.controller.config.yang.config.remote_rpc_connector;
 
-import akka.actor.ActorSystem;
-import org.opendaylight.controller.remote.rpc.RemoteRpcProviderConfig;
-import org.opendaylight.controller.remote.rpc.RemoteRpcProviderFactory;
-import org.opendaylight.controller.sal.core.api.Broker;
-import org.osgi.framework.BundleContext;
+import org.opendaylight.controller.sal.common.util.NoopAutoCloseable;
 
 public class RemoteRPCBrokerModule extends org.opendaylight.controller.config.yang.config.remote_rpc_connector.AbstractRemoteRPCBrokerModule {
-    private BundleContext bundleContext;
     public RemoteRPCBrokerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
         super(identifier, dependencyResolver);
     }
@@ -27,19 +30,9 @@ public class RemoteRPCBrokerModule extends org.opendaylight.controller.config.ya
     }
 
     @Override
-    public java.lang.AutoCloseable createInstance() {
-        Broker broker = getDomBrokerDependency();
-
-        ActorSystem actorSystem = getActorSystemProviderDependency().getActorSystem();
-        RemoteRpcProviderConfig config = new RemoteRpcProviderConfig.Builder(actorSystem.name())
-                .metricCaptureEnabled(getEnableMetricCapture())
-                .mailboxCapacity(getBoundedMailboxCapacity())
-                .build();
-
-        return RemoteRpcProviderFactory.createInstance(broker, bundleContext, actorSystem, config);
-    }
-
-    public void setBundleContext(BundleContext bundleContext) {
-        this.bundleContext = bundleContext;
+    public AutoCloseable createInstance() {
+        // The RemoteRpcProvider is created via blueprint and doesn't advertise any services so return a
+        // no-op here for backwards compatibility.
+        return NoopAutoCloseable.INSTANCE;
     }
 }