- LOG.debug("Starting all rpc listeners.");
- // Create actor to handle and sync routing table in cluster
- ClusterWrapper clusterWrapper = new ClusterWrapperImpl(actorSystem);
- rpcRegistry = actorSystem.actorOf(RpcRegistry.props(clusterWrapper), "rpc-registry");
-
- // Create actor to invoke and execute rpc
- SchemaService schemaService = brokerSession.getService(SchemaService.class);
- SchemaContext schemaContext = schemaService.getGlobalContext();
- rpcBroker = actorSystem.actorOf(RpcBroker.props(brokerSession, rpcRegistry, schemaContext), "rpc-broker");
- String rpcBrokerPath = clusterWrapper.getAddress().toString() + "/user/rpc-broker";
- rpcListener = new RpcListener(rpcRegistry, rpcBrokerPath);
- routeChangeListener = new RoutedRpcListener(rpcRegistry, rpcBrokerPath);
- rpcImplementation = new RemoteRpcImplementation(rpcBroker, schemaContext);
- brokerSession.addRpcRegistrationListener(rpcListener);
- rpcProvisionRegistry.registerRouteChangeListener(routeChangeListener);
- rpcProvisionRegistry.setRoutedRpcDefaultDelegate(rpcImplementation);
- announceSupportedRpcs();
- announceSupportedRoutedRpcs();
-
+ LOG.info("Starting remote rpc service...");
+
+ final SchemaService schemaService = brokerSession.getService(SchemaService.class);
+ final DOMRpcService rpcService = brokerSession.getService(DOMRpcService.class);
+ schemaContext = schemaService.getGlobalContext();
+ rpcManager = actorSystem.actorOf(RpcManager.props(schemaContext,
+ rpcProvisionRegistry, rpcService), config.getRpcManagerName());
+ schemaListenerRegistration = schemaService.registerSchemaContextListener(this);
+ LOG.debug("rpc manager started");