@Override protected Class<?> resolveFallbackIfPossible(String className, ClassNotFoundException ex) throws IOException, ClassNotFoundException { // If codebaseUrl is set, try to load the class with the RMIClassLoader. // Else, propagate the ClassNotFoundException. if (this.codebaseUrl == null) { throw ex; } return RMIClassLoader.loadClass(this.codebaseUrl, className); }
@Override protected ClassLoader getFallbackClassLoader() throws IOException { return RMIClassLoader.getClassLoader(this.codebaseUrl); }
/** * 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); } }
@Override protected Object exportImpl(RemoteStreamServer<?, ?> server) throws RemoteException { return UnicastRemoteObject.exportObject(server, port, clientSocketFactory, serverSocketFactory); }
public JmxTransRMIClientSocketFactory(int timeoutMillis, boolean ssl){ this.timeoutMillis = timeoutMillis; this.rmiClientSocketFactory = ssl ? new SslRMIClientSocketFactory() : RMISocketFactory.getDefaultSocketFactory(); }
@Override public Socket createSocket(String host, int port) throws IOException { Socket socket = rmiClientSocketFactory.createSocket(host, port); socket.setSoTimeout( timeoutMillis ); socket.setSoLinger( false, 0 ); return socket; } }
@Override protected void unexportImpl(RemoteStreamServer<?, ?> server) throws Exception { UnicastRemoteObject.unexportObject(server, true); } }
@Override protected Class<?> resolveFallbackIfPossible(String className, ClassNotFoundException ex) throws IOException, ClassNotFoundException { // If codebaseUrl is set, try to load the class with the RMIClassLoader. // Else, propagate the ClassNotFoundException. if (this.codebaseUrl == null) { throw ex; } return RMIClassLoader.loadClass(this.codebaseUrl, className); }
@Override protected ClassLoader getFallbackClassLoader() throws IOException { return RMIClassLoader.getClassLoader(this.codebaseUrl); }
/** * 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); } } }
/** * 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); } }
/** * 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); } } }
public static void cleanup() { for (Iterator i = remotes.iterator(); i.hasNext(); ) { Object remoteObject = i.next(); try { UnicastRemoteObject.unexportObject((Remote) remoteObject, true); } catch (Exception e) { } } } }
/** * Stops this MBean: rmiregistry cannot accept anymore incoming calls * * @see #start */ @Override public synchronized void stop() throws NoSuchObjectException { if (isRunning()) { isRunning = !UnicastRemoteObject.unexportObject(registry, true); } }
public void unreferenced() { try { UnicastRemoteObject.unexportObject(this, false); } catch (NoSuchObjectException e) { LOG.warn("Failed to unexport RMI debugger listener", e); } }
public void stop() throws IOException { if (connector != null) { try { connector.stop(); } finally { connector = null; } } if (rmiRegistry != null) { try { UnicastRemoteObject.unexportObject(rmiRegistry, true); } catch (NoSuchObjectException e) { throw new IOException("Could not un-export our RMI registry", e); } finally { rmiRegistry = null; } } } }
public void stopConnectorServer() throws IOException { synchronized (JMXListener.class) { if (JMX_CS != null) { JMX_CS.stop(); LOG.info("ConnectorServer stopped!"); JMX_CS = null; } // deregister the RMI registry if (rmiRegistry != null) { UnicastRemoteObject.unexportObject(rmiRegistry, true); } } }
public static void destroyRmiRegistry(Registry reg) { try { if (reg != null) { java.rmi.server.UnicastRemoteObject.unexportObject(reg, true); } } catch (NoSuchObjectException e) { throw new RuntimeException(e); } } }
@Override void shutdownSpi() { server.stop(); try { UnicastRemoteObject.unexportObject(this.debugger, true); } catch (Exception e) { } RmiDebuggedEnvironmentImpl.cleanup(); } }