Registry registry = LocateRegistry.getRegistry("localhost", Registry.REGISTRY_PORT); EchoServer es = (EchoServer)registry.lookup("echo"); System.err.println("es: " + es); System.out.println(es.echo("hallo"));
public RemoteDUnitVMIF getStub(String version, int i) throws RemoteException, NotBoundException, InterruptedException { waitForVMs(DUnitLauncher.STARTUP_TIMEOUT); return (RemoteDUnitVMIF) registry.lookup("vm" + i); }
protected RemotableQuartzScheduler getRemoteScheduler() throws SchedulerException { if (rsched != null) { return rsched; } try { Registry registry = LocateRegistry.getRegistry(rmiHost, rmiPort); rsched = (RemotableQuartzScheduler) registry.lookup(schedId); } catch (Exception e) { SchedulerException initException = new SchedulerException( "Could not get handle to remote scheduler: " + e.getMessage(), e); throw initException; } return rsched; }
protected RemotableQuartzScheduler getRemoteScheduler() throws SchedulerException { if (rsched != null) { return rsched; } try { Registry registry = LocateRegistry.getRegistry(rmiHost, rmiPort); rsched = (RemotableQuartzScheduler) registry.lookup(schedId); } catch (Exception e) { SchedulerException initException = new SchedulerException( "Could not get handle to remote scheduler: " + e.getMessage(), e); throw initException; } return rsched; }
stub = registry.lookup(name);
@Override public BounceResult bounce(String version, int pid, boolean force) { processManager.bounce(version, pid, force); try { if (!processManager.waitForVMs(DUnitLauncher.STARTUP_TIMEOUT)) { throw new RuntimeException(DUnitLauncher.STARTUP_TIMEOUT_MESSAGE); } RemoteDUnitVMIF remote = (RemoteDUnitVMIF) registry.lookup(VM.getVMName(VersionManager.CURRENT_VERSION, pid)); return new BounceResult(pid, remote); } catch (RemoteException | NotBoundException e) { throw new RuntimeException("could not lookup name", e); } catch (InterruptedException e) { throw new RuntimeException("Failed waiting for VM", e); } } }
RMIServer jmxrmiServer = (RMIServer)registry.lookup("jmxrmi"); System.out.println(jmxrmiServer.toString());
final Remote remote = registry.lookup(REMOTE_NAME); final RemoteOperations stub = RemoteOperations.class.cast(remote); final String message = stub.remoteOperation();
private static int startLocator(Registry registry) throws IOException, NotBoundException { RemoteDUnitVMIF remote = (RemoteDUnitVMIF) registry.lookup("vm" + LOCATOR_VM_NUM); final File locatorLogFile = LOCATOR_LOG_TO_DISK ? new File("locator-" + locatorPort + ".log") : new File("");
Registry registry = LocateRegistry.getRegistry(host, port, new SslRMIClientSocketFactory()); try { rmiServer = (RMIServer) registry.lookup("jmxrmi"); } catch (NotBoundException nbe) { throw (IOException) Registry registry = LocateRegistry.getRegistry(host, port); try { rmiServer = (RMIServer) registry.lookup("jmxrmi"); } catch (NotBoundException nbe) { System.out.println("Failed using LocateRegistry. Fallback to JMXConnectorFactory");
stub = registry.lookup(name);
private void executeInSeparateProcess() throws MojoExecutionException { DaemonInfo daemon; try { daemon = BuildDaemon.start(false, processMemory, new DaemonLogImpl(), createDaemonClassPath()); } catch (Throwable e) { throw new MojoExecutionException("Error starting TeaVM process", e); } try { RemoteBuildService buildService; try { Registry registry = LocateRegistry.getRegistry(daemon.getPort()); buildService = (RemoteBuildService) registry.lookup(RemoteBuildService.ID); } catch (RemoteException | NotBoundException e) { throw new MojoExecutionException("Error connecting TeaVM process", e); } RemoteBuildStrategy builder = new RemoteBuildStrategy(buildService); executeWithBuilder(builder); } finally { daemon.getProcess().destroy(); } }
/** * Returns a reference to the remote object. * * @param name the name of the cache e.g. <code>sampleCache1</code> */ protected Remote lookupPeer(String name) throws CacheException { try { return registry.lookup(name); } catch (Exception e) { throw new CacheException("Unable to lookup peer for replicated cache " + name + " " + e.getMessage()); } }
@SuppressWarnings("unchecked") public static <T extends Service> T lookup(String name, Class<T> serviceClass) throws Exception { RemoteEndpoint re = (RemoteEndpoint) registry.lookup(name); Service service = (Service) Proxy.newProxyInstance(re.getClass() .getClassLoader(), new Class<?>[] { serviceClass }, new ServiceDelegator(re)); return (T) service; }
ClientCallbackInterface client = new ClientImpl(); UnicastRemoteObject.exportObject(client); Registry registry = LocateRegistry.getRegistry(serverIp, serverRegistryPort); Server server = (Server) registry.lookup(serviceName); server.register(client);
public static EagleManager getManager(String host, int port, String password) throws RemoteException, NotBoundException { Registry registry = LocateRegistry.getRegistry(host,port); EagleLogin eagleLogin = (EagleLogin) registry.lookup("eagleLogin"); return eagleLogin.login(password); }
private Adaptor getRemoteAdapter(String address) throws LLRPRuntimeException, RemoteException { try { // try to get the instance from the remote // adaptor. Registry registry = LocateRegistry.getRegistry(address, Constants.REGISTRY_PORT); return (Adaptor) registry.lookup(Constants.ADAPTOR_NAME_IN_REGISTRY); } catch (NotBoundException ex) { throw new LLRPRuntimeException("Could not get a handle on the remote adaptor", ex); } }
public void init(Registry registry) throws AccessException, RemoteException, NotBoundException { for(int i = 0; i < numVms; i++) { RemoteTestModuleIF remote = (RemoteTestModuleIF) registry.lookup("vm" + i); addVM(i, "vm" + i, remote); } //for ease of debugging, add another VM that is the local host. addVM(numVms, "vm" + numVms, new FakeRemoteTestModule(Log.getLogWriter())); addLocator(numVms+1, "vm" + numVms + 1, (RemoteTestModuleIF) registry.lookup("vm" + NUM_VMS)); addHost(this); }
protected Pingable getPingableService(final ConsoleContext context) throws NotBoundException, RemoteException { final Registry registry = context.getRegistry(); final Remote remoteObject = registry.lookup(getServiceName()); Assert.notNull(remoteObject, "The remote object was null!"); Assert.instanceOf(remoteObject, Pingable.class, "The remote object must be an instance of Pingable to invoke this command!"); return (Pingable) remoteObject; }