Refine search
/** * <p> * Un-bind the scheduler from an RMI registry. * </p> */ private void unBind() throws RemoteException { String host = resources.getRMIRegistryHost(); // don't un-export if we're not configured to do so... if (host == null || host.length() == 0) { return; } Registry registry = LocateRegistry.getRegistry(resources .getRMIRegistryHost(), resources.getRMIRegistryPort()); String bindName = resources.getRMIBindName(); try { registry.unbind(bindName); UnicastRemoteObject.unexportObject(this, true); } catch (java.rmi.NotBoundException nbe) { } getLog().info("Scheduler un-bound from name '" + bindName + "' in RMI registry"); }
.exportObject(this, resources.getRMIServerPort()); } else { exportable = (RemotableQuartzScheduler) UnicastRemoteObject .exportObject(this); registry = LocateRegistry.getRegistry(resources .getRMIRegistryPort()); registry.list(); } catch (Exception e) { registry = LocateRegistry.createRegistry(resources .getRMIRegistryPort()); QuartzSchedulerResources.CREATE_REGISTRY_ALWAYS)) { try { registry = LocateRegistry.createRegistry(resources .getRMIRegistryPort()); } catch (Exception e) { registry.rebind(bindName, exportable);
final Remote remote = UnicastRemoteObject.exportObject(toBeStubbed, 0); final Registry registry = LocateRegistry.createRegistry(Registry.REGISTRY_PORT); registry.bind(REMOTE_NAME, remote); final Registry registry = LocateRegistry.getRegistry(); final Remote remote = registry.lookup(REMOTE_NAME); final RemoteOperations stub = RemoteOperations.class.cast(remote); final String message = stub.remoteOperation();
@Override public void start(Server server) throws IOException { registry = LocateRegistry.createRegistry(rmiRegistryPort); exportedServer = new RemoteServerImpl(server); UnicastRemoteObject.exportObject(exportedServer, serverPort); ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); registry.rebind(SERVER_NAME, exportedServer); } finally { Thread.currentThread().setContextClassLoader(oldClassLoader); } logger.info("Server advertised via rmi on port " + rmiRegistryPort); logger.info("Server exported via rmi on port " + serverPort); }
/** * Unexport the RMI registry on bean factory shutdown, * provided that this bean actually created a registry. */ @Override public void destroy() throws RemoteException { if (this.created) { logger.debug("Unexporting RMI registry"); UnicastRemoteObject.unexportObject(this.registry, true); } }
public void stopServer() { try { registry.unbind(SERVICE_NAME); UnicastRemoteObject.unexportObject(registry, true); } catch (Exception e) { e.printStackTrace(); } } }
private void startService () throws RemoteException { try { LocateRegistry.createRegistry (Registry.REGISTRY_PORT); } catch (ExportException ignored) { // NOPMD registry already exists } stub = UnicastRemoteObject.exportObject (this); ref = stub.getRef(); } public boolean isConnected() {
rmiRegistry = LocateRegistry.createRegistry(rmiRegistryPort); UnicastRemoteObject.unexportObject(rmiRegistry, true);
private void export() throws RemoteException, AccessException { String port = System.getProperty( RMI_PORT_KEY, "1099" ); name = System.getProperty( RMI_NAME_KEY ); timeout = Long.parseLong( System.getProperty( TIMEOUT_KEY, "10000") ); String address = InetAddress.getLoopbackAddress().getHostAddress(); registry = LocateRegistry.getRegistry( address, Integer.parseInt( port ) ); URL location1 = getClass().getProtectionDomain().getCodeSource().getLocation(); URL location2 = Bundle.class.getProtectionDomain().getCodeSource().getLocation(); URL location3 = ServiceLookup.class.getProtectionDomain().getCodeSource().getLocation(); System.setProperty( "java.rmi.server.codebase", location1 + " " + location2 + " " + location3 ); Remote remote = UnicastRemoteObject.exportObject( this, 0 ); registry.rebind( name, remote ); }
RMISocketFactory sf = new MySocketFactory(); UnicastRemoteObject.unexportObject(export, true); Remote stub = UnicastRemoteObject.exportObject(export, 0, sf, sf); String url = "rmi://0.0.0.0:" + Registry.REGISTRY_PORT + "/Hello"; LocateRegistry.createRegistry(Registry.REGISTRY_PORT); Naming.rebind(url, stub);
@Override protected Object exportImpl(RemoteStreamServer<?, ?> server) throws RemoteException { return UnicastRemoteObject.exportObject(server, port, clientSocketFactory, serverSocketFactory); }
/** * Binds the session object, an instance of {@link MatlabSession} to the registry with {@link #SESSION_ID}. * * @throws MatlabConnectionException */ private static void bindSession() throws MatlabConnectionException { //Unexport the object, it will throw an exception if it is not bound - so ignore that try { UnicastRemoteObject.unexportObject(_session, true); } catch (NoSuchObjectException e) {} try { _registry.bind(_session.getSessionID(), LocalHostRMIHelper.exportObject(_session)); } catch (Exception e) { throw new MatlabConnectionException("Could not register this session of MATLAB", e); } }
UnicastRemoteObject.exportObject( this.exportedObject, this.servicePort, this.clientSocketFactory, this.serverSocketFactory); UnicastRemoteObject.exportObject(this.exportedObject, this.servicePort); this.registry.rebind(this.serviceName, this.exportedObject); this.registry.bind(this.serviceName, this.exportedObject);
public void processCommand(String line) { try { if(isClient) UnicastRemoteObject.exportObject(receiver); ResultReceiver result = server.processCommand(line, firewall ? null : receiver); // If using a firewall, no callbacks if(result != null) // But whatever is returned is then added to the receiver receiver.addResult(result); if(isClient) UnicastRemoteObject.unexportObject(receiver, false); } catch(RemoteException e) { throw new RuntimeException(e); } }
private void loadRMITransport(RMITransport transport) throws RemoteException, AlreadyBoundException { int serverPort = transport.getServerPort(); Remote remote = UnicastRemoteObject.exportObject(loginService, serverPort); transport.getRegistry().bind(LoginService.SERVICE, remote); logger.info("Authentication service started"); }
private void bindRBC(Registry _registry, String name, BundleContext bundleContext) throws RemoteException, BundleException { LOG.debug("Now Binding " + RemoteBundleContext.class.getSimpleName() + " as name=" + name + " to RMI registry"); remoteBundleContext = new RemoteBundleContextImpl(bundleContext.getBundle(0) .getBundleContext()); Remote remoteStub = UnicastRemoteObject.exportObject(remoteBundleContext, 0); _registry.rebind(getName(), remoteStub); }
public static String getClientHost(){ try { return UnicastRemoteObject.getClientHost(); } catch (ServerNotActiveException e) { throw new RuntimeException(e); } } }
myListener = (MapReduceListener) UnicastRemoteObject.exportObject(myListener, 0); Registry registry = LocateRegistry.createRegistry(port); log.debug(registry.toString()); registry.rebind(name, myListener); if (debug) log.info("Binding complete.");
/** * Unexport the registered RMI object, logging any exception that arises. */ private void unexportObjectSilently() { try { UnicastRemoteObject.unexportObject(this.exportedObject, true); } catch (NoSuchObjectException ex) { if (logger.isInfoEnabled()) { logger.info("RMI object for service '" + this.serviceName + "' is not exported anymore", ex); } } }
private boolean deregister() { try { registry.unbind("RemoteSleeConnectionService"); return UnicastRemoteObject.unexportObject(registry, false); } catch (RemoteException e) { throw new RuntimeException("Failed to unbind due to", e); } catch (NotBoundException e) { throw new RuntimeException("Failed to unbind due to", e); } }