private void registerImplementation(final Class<RpcService> interfaceClass) { if (!interfaceClass.isInstance(implementation)) { throw new ComponentDefinitionException(String.format( "The specified \"interface\" %s for \"%s\" is not implemented by RpcService \"ref\" %s", interfaceName, ACTION_PROVIDER, implementation.getClass())); } reg = bindingRpcProvider.registerRpcImplementation(interfaceClass, implementation); LOG.debug("Registered implementation {} for {}", implementation, interfaceName); } }
@SuppressWarnings("checkstyle:IllegalCatch") public void init() { try { List<Class<RpcService>> rpcInterfaces = getImplementedRpcServiceInterfaces(interfaceName, implementation.getClass(), bundle, RPC_IMPLEMENTATION); LOG.debug("{}: init - adding implementation {} for RpcService interface(s) {}", bundle.getSymbolicName(), implementation, rpcInterfaces); for (Class<RpcService> rpcInterface : rpcInterfaces) { rpcRegistrations.add(rpcProvider.registerRpcImplementation(rpcInterface, implementation)); } } catch (final ComponentDefinitionException e) { throw e; } catch (final Exception e) { throw new ComponentDefinitionException(String.format( "Error processing \"%s\" for %s", RPC_IMPLEMENTATION, implementation.getClass()), e); } }
public void register(final EventSource eventSource) { final NodeKey nodeKey = eventSource.getSourceNodeKey(); final KeyedInstanceIdentifier<Node, NodeKey> sourcePath = EVENT_SOURCE_TOPOLOGY_PATH.child(Node.class, nodeKey); final Registration reg = rpcRegistry.registerRpcImplementation(EventSourceService.class, eventSource, Collections.singleton(sourcePath)); routedRpcRegistrations.put(nodeKey, reg); insert(sourcePath); }
public EventSourceTopology(final DataBroker dataBroker, final RpcProviderService providerService, RpcConsumerRegistry rpcService) { this.dataBroker = dataBroker; this.rpcRegistry = providerService; aggregatorRpcReg = providerService.registerRpcImplementation(EventAggregatorService.class, this); eventSourceService = rpcService.getRpcService(EventSourceService.class); final TopologyEventSource topologySource = new TopologyEventSourceBuilder().build(); final TopologyTypes1 topologyTypeAugment = new TopologyTypes1Builder().setTopologyEventSource(topologySource).build(); putData(OPERATIONAL, TOPOLOGY_TYPE_PATH, topologyTypeAugment); LOG.info("EventSourceRegistry has been initialized"); }