@Test public void basics() { RemoteServiceContext remoteServiceContext = rpcDirectory.get(LOCAL_URI); assertNotNull("Expecting valid RPC context", remoteServiceContext); SomeOtherService someService = remoteServiceContext.get(SomeOtherService.class); assertNotNull("Expecting reference to sample service", someService); assertEquals("Goodbye", someService.hello()); }
@Override public RemoteServiceContext get(URI uri) { RemoteServiceContextProvider factory = getProvider(uri.getScheme()); if (factory != null) { return factory.get(uri); } throw new UnsupportedOperationException(uri.getScheme() + " not supported"); }
RemoteServiceManager extends AbstractProviderRegistry implements RemoteServiceDirectory, RemoteServiceProviderRegistry { @Override public RemoteServiceContext get(URI uri) { RemoteServiceContextProvider factory = getProvider(uri.getScheme()); if (factory != null) { return factory.get(uri); } throw new UnsupportedOperationException(uri.getScheme() + " not supported"); } }
RemoteServiceManager extends AbstractProviderRegistry implements RemoteServiceDirectory, RemoteServiceProviderRegistry { @Override public RemoteServiceContext get(URI uri) { RemoteServiceContextProvider factory = getProvider(uri.getScheme()); if (factory != null) { return factory.get(uri); } throw new UnsupportedOperationException(uri.getScheme() + " not supported"); }  }
RemoteServiceManager extends AbstractProviderRegistry implements RemoteServiceDirectory, RemoteServiceProviderRegistry { @Override public RemoteServiceContext get(URI uri) { RemoteServiceContextProvider factory = getProvider(uri.getScheme()); if (factory != null) { return factory.get(uri); } throw new UnsupportedOperationException(uri.getScheme() + " not supported"); }  @Override RemoteServiceContext get(URI uri); }
RemoteServiceManager extends AbstractProviderRegistry implements RemoteServiceDirectory, RemoteServiceProviderRegistry { @Override public RemoteServiceContext get(URI uri) { RemoteServiceContextProvider factory = getProvider(uri.getScheme()); if (factory != null) { return factory.get(uri); } throw new UnsupportedOperationException(uri.getScheme() + " not supported"); }  @Override RemoteServiceContext get(URI uri);  }