Package java.rmi.registry

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


        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


      /*
       * Call list() to force a remote call - this
       * confirms if the registry is up and running
       */
      String s[] = registry.list();
      registryExists = true;
  } catch(RemoteException re)  {
      /*
       * An exception will be caught if there is no registry running
       * at the specified port. Not a problem since we are about
View Full Code Here

      /*
       * Call list() to force a remote call - this
       * confirms if the registry is up and running
       */
      String s[] = registry.list();
            logger.log(Logger.INFO,
    rb.getString(rb.I_JMX_RMI_REGISTRY_STARTED, Integer.toString(port)));
  } catch(RemoteException re)  {
      throw new BrokerException(
    rb.getString(rb.W_JMX_RMI_REGISTRY_STARTED_EXCEPTION,
View Full Code Here

          registry = null;
        }
        if (null == registry) {
          registry = LocateRegistry.createRegistry(port);
        }
        registry.list();
        String serverURL = "service:jmx:rmi:///jndi/rmi://" + host
            + ":" + port + "/" + rmiName;
        JMXServiceURL url = new JMXServiceURL(serverURL);
        connectorServer = JMXConnectorServerFactory
            .newJMXConnectorServer(url, null, mbserver);
View Full Code Here

        String rmiName = System.getProperty(
            Constants.XMEMCACHED_RMI_NAME, "xmemcachedServer");
        Registry registry = null;
        try {
          registry = LocateRegistry.getRegistry(port);
          registry.list();
        } catch (Exception e) {
          registry = null;
        }
        if (null == registry) {
          registry = LocateRegistry.createRegistry(port);
View Full Code Here

            boolean rmiregistryFound=true;
            try{
                //list bounded name in this registry: if rmiregistry is not running, this will throw an exception
                System.out.println("try to get registry list");
                String []a=registry.list();
                System.out.println(a.length + " names bound in the registry");
                for(int i=0;i<a.length;i++)
                    System.out.println(i+"\t"+a[i]);
            }catch(Exception e)
            {   //need to start rmiregistry
View Full Code Here

                if(now-start>1000) throw new RuntimeException("rmiregistry is not responsive");

                try{
                    registry = LocateRegistry.getRegistry();
                    //list bounded name in this registry: if rmiregistry is not running, this will throw an exception
                    String []a=registry.list();
                    System.out.println(a.length + " names bound in the registry:");
                    for(int i=0;i<a.length;i++)
                        System.out.println(a[i]);
                    rmiregistryFound=true;
                }catch(Exception e)
View Full Code Here

        String serverAddress = InetAddress.getLocalHost().getHostAddress();
        Registry registry = LocateRegistry.getRegistry(serverAddress);

        try {
            //list bounded name in this registry: if rmiregistry is not running, this will throw an exception
            String[] a = registry.list();
            for (int i = 0; i < a.length; i++) {
                System.out.println(a[i]);
            }

        } catch (Exception e) {   //need to start card reader manager
View Full Code Here

    try {
      thread.setContextClassLoader(ClassLoader.getSystemClassLoader());

      try {
        Registry reg = LocateRegistry.getRegistry(_port);
        reg.list()// Verify it's alive and well
        if (log.isLoggable(Level.CONFIG))
          log.config(L.l("found RMI Registry on port `{0}'",
                         _port));
      }
      catch (Exception e) {
View Full Code Here

            // rmi.00=URL could not be null.
            throw new NullPointerException(Messages.getString("rmi.00")); //$NON-NLS-1$
        }
        RegistryURL url = getRegistryURL(name, true);
        Registry reg = LocateRegistry.getRegistry(url.host, url.port);
        String[] names = reg.list();
        String regName = "//" + ((url.host == null) ? "" : url.host) + ":" + url.port + "/"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$

        for (int i = 0; i < names.length; ++i) {
            names[i] = regName + names[i];
        }
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.