X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fremote%2Frpc%2FRemoteRpcProvider.java;h=51e56d0d984dcf93e7e47843f11c18d57bdfab8c;hp=a0e1f87874df9009728f0a6e732e1d27319ad3e9;hb=c55d6cccb33e3de942e521e31404a60c1738b768;hpb=2418a6052d7eba917d5972f0630cf746d22f690c diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteRpcProvider.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteRpcProvider.java index a0e1f87874..51e56d0d98 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteRpcProvider.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteRpcProvider.java @@ -12,13 +12,8 @@ import akka.actor.ActorRef; import akka.actor.ActorSystem; import akka.actor.PoisonPill; import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableSet; -import java.util.Collection; import org.opendaylight.controller.md.sal.dom.api.DOMRpcProviderService; import org.opendaylight.controller.md.sal.dom.api.DOMRpcService; -import org.opendaylight.controller.sal.core.api.Broker; -import org.opendaylight.controller.sal.core.api.Provider; -import org.opendaylight.controller.sal.core.api.model.SchemaService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -26,33 +21,25 @@ import org.slf4j.LoggerFactory; * This is the base class which initialize all the actors, listeners and * default RPc implementation so remote invocation of rpcs. */ -public class RemoteRpcProvider implements AutoCloseable, Provider { +public class RemoteRpcProvider implements AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(RemoteRpcProvider.class); private final DOMRpcProviderService rpcProvisionRegistry; private final RemoteRpcProviderConfig config; private final ActorSystem actorSystem; + private final DOMRpcService rpcService; - private DOMRpcService rpcService; - private SchemaService schemaService; private ActorRef rpcManager; public RemoteRpcProvider(final ActorSystem actorSystem, final DOMRpcProviderService rpcProvisionRegistry, - final RemoteRpcProviderConfig config) { - this.actorSystem = actorSystem; - this.rpcProvisionRegistry = rpcProvisionRegistry; + final DOMRpcService rpcService, final RemoteRpcProviderConfig config) { + this.actorSystem = Preconditions.checkNotNull(actorSystem); + this.rpcProvisionRegistry = Preconditions.checkNotNull(rpcProvisionRegistry); + this.rpcService = Preconditions.checkNotNull(rpcService); this.config = Preconditions.checkNotNull(config); } - public void setRpcService(final DOMRpcService rpcService) { - this.rpcService = rpcService; - } - - public void setSchemaService(final SchemaService schemaService) { - this.schemaService = schemaService; - } - @Override public void close() { if (rpcManager != null) { @@ -62,17 +49,6 @@ public class RemoteRpcProvider implements AutoCloseable, Provider { } } - @Override - public void onSessionInitiated(final Broker.ProviderSession session) { - rpcService = session.getService(DOMRpcService.class); - start(); - } - - @Override - public Collection getProviderFunctionality() { - return ImmutableSet.of(); - } - public void start() { LOG.info("Starting Remote RPC service..."); rpcManager = actorSystem.actorOf(RpcManager.props(rpcProvisionRegistry, rpcService, config),