RemoteRpcRegistryMXBeanImpl extends AbstractRegistryMXBean<RoutingTable, DOMRpcIdentifier> implements RemoteRpcRegistryMXBean { @Override public Set<String> getGlobalRpc() { RoutingTable table = localData(); Set<String> globalRpc = new HashSet<>(table.getItems().size()); for (DOMRpcIdentifier route : table.getItems()) { if (route.getContextReference().isEmpty()) { globalRpc.add(route.getType().toString()); } } log.debug("Locally registered global RPCs {}", globalRpc); return globalRpc; } RemoteRpcRegistryMXBeanImpl(final BucketStoreAccess rpcRegistryAccess, final Timeout timeout); @Override Set<String> getGlobalRpc(); @Override Set<String> getLocalRegisteredRoutedRpc(); @Override Map<String, String> findRpcByName(final String name); @Override Map<String, String> findRpcByRoute(final String routeId); @Override String getBucketVersions();  }
@Test public void testGetGlobalRpcEmptyBuckets() { final Set<String> globalRpc = mxBean.getGlobalRpc(); assertNotNull(globalRpc); assertTrue(globalRpc.isEmpty()); }
@Test public void testGetGlobalRpc() { testActor.tell(new RpcRegistry.Messages.AddOrUpdateRoutes(Lists.newArrayList(buckets)), ActorRef.noSender()); final Set<String> globalRpc = mxBean.getGlobalRpc(); assertNotNull(globalRpc); assertEquals(1, globalRpc.size()); final String rpc = globalRpc.iterator().next(); assertEquals(REMOTE_QNAME.toString(), rpc); }