X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fremote%2Frpc%2FRemoteRpcProvider.java;h=8b4ce31d2ea0ee7e82352e72fd5249b37e6873a6;hb=65292f0c7ee04222ccaaa9c9dcf9ece4438dc96e;hp=d088f2284d65904cc90d3aa3d6f39a4ca2cc99aa;hpb=3dd9d7c6da1baaf72f05e1118c0ca47dc16e3c7b;p=controller.git 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 d088f2284d..8b4ce31d2e 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 @@ -31,21 +31,25 @@ public class RemoteRpcProvider implements AutoCloseable, Provider, SchemaContext private static final Logger LOG = LoggerFactory.getLogger(RemoteRpcProvider.class); - private final ActorSystem actorSystem; private final RpcProvisionRegistry rpcProvisionRegistry; + + private ActorSystem actorSystem; private Broker.ProviderSession brokerSession; private SchemaContext schemaContext; private ActorRef rpcManager; + private RemoteRpcProviderConfig config; public RemoteRpcProvider(ActorSystem actorSystem, RpcProvisionRegistry rpcProvisionRegistry) { this.actorSystem = actorSystem; this.rpcProvisionRegistry = rpcProvisionRegistry; + this.config = new RemoteRpcProviderConfig(actorSystem.settings().config()); } @Override public void close() throws Exception { - this.actorSystem.shutdown(); + if (this.actorSystem != null) + this.actorSystem.shutdown(); } @Override @@ -60,17 +64,17 @@ public class RemoteRpcProvider implements AutoCloseable, Provider, SchemaContext } private void start() { - LOG.info("Starting all rpc listeners and actors."); - // Create actor to handle and sync routing table in cluster + LOG.info("Starting remote rpc service..."); + SchemaService schemaService = brokerSession.getService(SchemaService.class); schemaContext = schemaService.getGlobalContext(); - rpcManager = actorSystem.actorOf(RpcManager.props(schemaContext, brokerSession, rpcProvisionRegistry), ActorConstants.RPC_MANAGER); + rpcManager = actorSystem.actorOf(RpcManager.props(schemaContext, brokerSession, rpcProvisionRegistry), + config.getRpcManagerName()); - LOG.debug("Rpc actors are created."); + LOG.debug("rpc manager started"); } - @Override public void onGlobalContextUpdated(SchemaContext schemaContext) { this.schemaContext = schemaContext;