Package java.rmi.registry

Examples of java.rmi.registry.Registry


        if (name == null) {
            // rmi.00=URL could not be null.
            throw new NullPointerException(Messages.getString("rmi.00")); //$NON-NLS-1$
        }
        RegistryURL url = getRegistryURL(name, false);
        Registry reg = LocateRegistry.getRegistry(url.host, url.port);
        return reg.lookup(url.name);
    }
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

        }
    }

    public void destroy() throws RemoteException {
        if (registry != null && locallyCreated) {
            Registry reg = registry;
            registry = null;
            UnicastRemoteObject.unexportObject(reg, true);
        }
    }
View Full Code Here

    if (registryHost != null) {
      // Host explictly specified: only lookup possible.
      if (logger.isInfoEnabled()) {
        logger.info("Looking for RMI registry at port '" + registryPort + "' of host [" + registryHost + "]");
      }
      Registry reg = LocateRegistry.getRegistry(registryHost, registryPort, clientSocketFactory);
      testRegistry(reg);
      return reg;
    }

    else {
View Full Code Here

      if (logger.isInfoEnabled()) {
        logger.info("Looking for RMI registry at port '" + registryPort + "', using custom socket factory");
      }
      try {
        // Retrieve existing registry.
        Registry reg = LocateRegistry.getRegistry(null, registryPort, clientSocketFactory);
        testRegistry(reg);
        return reg;
      }
      catch (RemoteException ex) {
        logger.debug("RMI registry access threw exception", ex);
View Full Code Here

    if (logger.isInfoEnabled()) {
      logger.info("Looking for RMI registry at port '" + registryPort + "'");
    }
    try {
      // Retrieve existing registry.
      Registry reg = LocateRegistry.getRegistry(registryPort);
      testRegistry(reg);
      return reg;
    }
    catch (RemoteException ex) {
      logger.debug("RMI registry access threw exception", ex);
View Full Code Here

    if (registryHost != null) {
      // Host explictly specified: only lookup possible.
      if (logger.isInfoEnabled()) {
        logger.info("Looking for RMI registry at port '" + registryPort + "' of host [" + registryHost + "]");
      }
      Registry reg = LocateRegistry.getRegistry(registryHost, registryPort, clientSocketFactory);
      testRegistry(reg);
      return reg;
    }

    else {
View Full Code Here

      if (logger.isInfoEnabled()) {
        logger.info("Looking for RMI registry at port '" + registryPort + "', using custom socket factory");
      }
      try {
        // Retrieve existing registry.
        Registry reg = LocateRegistry.getRegistry(null, registryPort, clientSocketFactory);
        testRegistry(reg);
        return reg;
      }
      catch (RemoteException ex) {
        logger.debug("RMI registry access threw exception", ex);
View Full Code Here

    if (logger.isInfoEnabled()) {
      logger.info("Looking for RMI registry at port '" + registryPort + "'");
    }
    try {
      // Retrieve existing registry.
      Registry reg = LocateRegistry.getRegistry(registryPort);
      testRegistry(reg);
      return reg;
    }
    catch (RemoteException ex) {
      logger.debug("RMI registry access threw exception", ex);
View Full Code Here

        String agentName = args[0];
        String registryHost = args[1];
        int registryPort = Integer.parseInt(args[2]);
        String processManagerName = args[3];

        Registry reg = LocateRegistry.getRegistry(registryHost, registryPort);

        final ProcessAgentImpl agent = new ProcessAgentImpl();

        agent.shutdownHook = new Thread(new Runnable() {
                public void run() {
                    agent.shutdownCountDown.release();
                    try {
                        agent.mainThread.join();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
        });
        Runtime.getRuntime().addShutdownHook(agent.shutdownHook);

        ProcessManagerRemoteIF manager = (ProcessManagerRemoteIF) reg.lookup(processManagerName);
        agent.init(agentName,manager);

        agent.waitForShutdown();
        agent.notifyManagerOnExit();
        if(agent.exitedFromParent) {
View Full Code Here

TOP

Related Classes of java.rmi.registry.Registry

Copyright © 2018 www.massapicom. 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.