Package java.rmi.registry

Examples of java.rmi.registry.Registry.list()


    public void init() throws RemoteException, UnknownHostException {
        if (registry == null && locate) {
            try {
                Registry reg = LocateRegistry.getRegistry(host, getPort());
                reg.list();
                registry = reg;
            } catch (RemoteException e) {
                // ignore
            }
        }
View Full Code Here


   */
  private List getCurrentBindings() throws NamingException {
    List names = null;
    try {
      Registry registry = getRegistry();
      names = Arrays.asList(registry.list());
    } catch (RemoteException ex) {
      names = Collections.EMPTY_LIST;
    }
    return names;
  }
View Full Code Here

      Registry rmiRegistry = LocateRegistry.getRegistry(registryPort);
      if(rmiRegistry != null)
      {
         try
         {
            rmiRegistry.list();
         }
         catch(RemoteException e)
         {
            rmiRegistry = LocateRegistry.createRegistry(registryPort);
         }
View Full Code Here

        try {
            registry = rmiRegistries.get(Integer.toString(port));
            if (registry == null) {
                try {
                    registry = LocateRegistry.getRegistry(port);
                    registry.list();
                } catch (RemoteException e) {
                    registry = LocateRegistry.createRegistry(port);
                }
                rmiRegistries.put(Integer.toString(port), registry);
            }
View Full Code Here

        try {
            registry = rmiRegistries.get(Integer.toString(port));
            if (registry == null) {
                try {
                    registry = LocateRegistry.getRegistry(port);
                    registry.list();
                } catch (RemoteException e) {
                    registry = LocateRegistry.createRegistry(port);
                }
                rmiRegistries.put(Integer.toString(port), registry);
            }
View Full Code Here

        try {
            registry = rmiRegistries.get(Integer.toString(port));
            if (registry == null) {
                try {
                    registry = LocateRegistry.getRegistry(port);
                    registry.list();
                } catch (RemoteException e) {
                    registry = LocateRegistry.createRegistry(port);
                }
                rmiRegistries.put(Integer.toString(port), registry);
            }
View Full Code Here

        super.destroy();
        for (Integer key : new ArrayList<Integer>(registryMap.keySet())) {
            Registry registry = registryMap.remove(key);
            if (registry != null) {
                try {
                    String[] services = registry.list();
                    if (services != null && services.length > 0) {
                        for (String service : services) {
                            if (logger.isInfoEnabled()) {
                                logger.info("Unbind rmi service: " + service);
                            }
View Full Code Here

        Registry registry = LocateRegistry.getRegistry(registryPort);

        // before we stop the context the registry is still exported, so list() should work
        Exception e;
        try {
            registry.list();
            e = null;
        } catch (NoSuchObjectException nsoe) {
            e = nsoe;
        }
        assertNull(e);
View Full Code Here

        context.stop();

        // stopping the Camel context unexported the registry, so list() should fail
        Exception e2;
        try {
            registry.list();
            e2 = null;
        } catch (NoSuchObjectException nsoe) {
            e2 = nsoe;
        }
        assertNotNull(e2);
View Full Code Here

    public void init() throws RemoteException, UnknownHostException {
        if (registry == null && locate) {
            try {
                Registry reg = LocateRegistry.getRegistry(host, getPort());
                reg.list();
                registry = reg;
            } catch (RemoteException e) {
                // ignore
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.