/** * Test the given RMI registry, calling some operation on it to * check whether it is still active. * <p>Default implementation calls {@code Registry.list()}. * @param registry the RMI registry to test * @throws RemoteException if thrown by registry methods * @see java.rmi.registry.Registry#list() */ protected void testRegistry(Registry registry) throws RemoteException { registry.list(); }
/** * Test the given RMI registry, calling some operation on it to * check whether it is still active. * <p>Default implementation calls {@code Registry.list()}. * @param registry the RMI registry to test * @throws RemoteException if thrown by registry methods * @see java.rmi.registry.Registry#list() */ protected void testRegistry(Registry registry) throws RemoteException { registry.list(); }
/** * Test the given RMI registry, calling some operation on it to * check whether it is still active. * <p>Default implementation calls {@code Registry.list()}. * @param registry the RMI registry to test * @throws RemoteException if thrown by registry methods * @see java.rmi.registry.Registry#list() */ protected void testRegistry(Registry registry) throws RemoteException { registry.list(); }
/** * Test the given RMI registry, calling some operation on it to * check whether it is still active. * <p>Default implementation calls {@code Registry.list()}. * @param registry the RMI registry to test * @throws RemoteException if thrown by registry methods * @see java.rmi.registry.Registry#list() */ protected void testRegistry(Registry registry) throws RemoteException { registry.list(); }
/** * Returns an array of the names bound in the rmiregistry * * @return an array of the names bound in the rmiregistry * @see java.rmi.registry.Registry#list() */ @Override public String[] list() throws RemoteException { if (!isRunning()) { throw new IllegalStateException("RMIRegistryService is not running"); } return registry.list(); }
public static void main(final String[] args) throws Exception { final String host = args[0]; final int port = Integer.parseInt(args[1]); final String command = args[3]; Registry registry = LocateRegistry.getRegistry(host, port); final String className = CommonsCollections1.class.getPackage().getName() + "." + args[2]; final Class<? extends ObjectPayload> payloadClass = (Class<? extends ObjectPayload>) Class.forName(className); // test RMI registry connection and upgrade to SSL connection on fail try { registry.list(); } catch(ConnectIOException ex) { registry = LocateRegistry.getRegistry(host, port, new RMISSLClientSocketFactory()); } // ensure payload doesn't detonate during construction or deserialization exploit(registry, payloadClass, command); }
String[] names = registry.list(); for (String name : names) { System.out.println("In the registry: " + name);
registry.list(); } catch (Exception e) { registry = LocateRegistry.createRegistry(resources
registry.list(); } catch (Exception e) { registry = LocateRegistry.createRegistry(resources
/** * Start the rmiregistry. * <p> * The alternative is to use the <code>rmiregistry</code> binary, in which case: * <ol> * <li>rmiregistry running * <li>-Djava.rmi.server.codebase="file:///Users/gluck/work/ehcache/build/classes/ file:///Users/gluck/work/ehcache/lib/commons-logging-1.0.4.jar" * </ol> * * @throws RemoteException */ protected void startRegistry() throws RemoteException { try { registry = LocateRegistry.getRegistry(port.intValue()); try { registry.list(); } catch (RemoteException e) { //may not be created. Let's create it. registry = LocateRegistry.createRegistry(port.intValue()); registryCreated = true; } } catch (ExportException exception) { LOG.error("Exception starting RMI registry. Error was " + exception.getMessage(), exception); } }
/** * Returns a list of bound objects. * <p> * This should match the list of cachePeers i.e. they should always be bound * * @return a list of String representations of <code>RMICachePeer</code> objects */ protected String[] listBoundRMICachePeers() throws CacheException { try { return registry.list(); } catch (RemoteException e) { throw new CacheException("Unable to list cache peers " + e.getMessage()); } }
try { registry = LocateRegistry.getRegistry(port); registry.list(); } catch (Exception e) { registry = null; registry = LocateRegistry.createRegistry(port); registry.list(); String serverURL = "service:jmx:rmi:///jndi/rmi://" + host + ":" + port + "/" + rmiName; JMXServiceURL url = new JMXServiceURL(serverURL);
Registry registry = null; try { registry = LocateRegistry.getRegistry(52365);//use any no. less than 55000 registry.list(); // This call will throw an exception if the registry does not already exist } catch (RemoteException e) { registry = LocateRegistry.createRegistry(52365); }
public String[] list () { try { return this.registry.list(); } catch (Exception e) { return null; } }
public class RegistryViewer { public static void main(String... args){ String host = args[0]; int port = Integer.parseInt(args[1]); Registry registry = LocateRegistry.getRegistry(host, port); for (String name : registry.list()) { System.out.println(name); } } }
/** * Returns an array of the names bound in the rmiregistry * * @return an array of the names bound in the rmiregistry * @see java.rmi.registry.Registry#list() */ public String[] list() throws RemoteException { if (!isRunning()) { throw new IllegalStateException("RMIRegistryService is not running"); } return registry.list(); }
public static boolean registryAvailable(int port) throws RemoteException, AccessException { try { Registry reg = LocateRegistry.getRegistry(port); reg.list(); //just a safe registry call, to see if the registry exists return true; } catch (java.rmi.ConnectException e) //this is what we get if no Registry is exported {return false;} }
/** * Returns an array of the names bound in the rmiregistry * * @return an array of the names bound in the rmiregistry * @see java.rmi.registry.Registry#list() */ public String[] list() throws RemoteException { if (!isRunning()) { throw new IllegalStateException("RMIRegistryService is not running"); } return registry.list(); }
public String[] list() throws RemoteException { if (!isRunning()) throw new IllegalStateException("NamingService is not running"); return m_registry.list(); }
@Override public void executeImpl(final ConsoleContext context) throws Exception { SystemUtils.printToStandardOut("Available services for host ({0}) listening on port ({1}): {2}", context.getHost(), context.getPort(), Arrays.asList(context.getRegistry().list())); } }