Package java.rmi.registry

Examples of java.rmi.registry.Registry


    }

    @Override
    protected void start() throws ServerSideException {
        try {// startup rmiregistry(global repository) on localhost
            Registry registry = prepareRegistry(_localRegistryPort);
            assert (registry != null);
        } catch (RemoteException e) {
            throw new ServerSideException("failed to launch registry on port " + _localRegistryPort, e);
        }
        super.start();
View Full Code Here


            LOG.debug("unbind failed", e);
        }
    }

    private static Registry prepareRegistry(int port) throws RemoteException {
        Registry registry;
        try {
            registry = LocateRegistry.createRegistry(port);
            LOG.info("created local rmi-registry at port: " + port);
        } catch (RemoteException e) {
            registry = LocateRegistry.getRegistry(port);
View Full Code Here

      log.debug("RMI server " + serverIndex + " created");

      // let RMI know the bind address
      System.setProperty("java.rmi.server.hostname", host);

      Registry registry;

      // try to bind first
      try
      {
         registry = LocateRegistry.getRegistry(DEFAULT_REGISTRY_PORT);
         registry.bind(RMI_SERVER_PREFIX + serverIndex, testServer);
         registry.bind(NAMING_SERVER_PREFIX + serverIndex, testServer.getNamingDelegate());

      }
      catch(Exception e)
      {
         log.info("Failure using an existing registry, trying creating it");

         // try to create it
         registry = LocateRegistry.createRegistry(DEFAULT_REGISTRY_PORT);

         registry.bind(RMI_SERVER_PREFIX + serverIndex, testServer);
         registry.bind(NAMING_SERVER_PREFIX + serverIndex, testServer.getNamingDelegate());
      }

      log.info("RMI server " + serverIndex + " bound");
   }
View Full Code Here

         try
         {
            // unregister myself from the RMI registry

            Registry registry = LocateRegistry.getRegistry(DEFAULT_REGISTRY_PORT);

            String name = RMI_SERVER_PREFIX + server.getServerID();
            registry.unbind(name);
            log.info("unregistered " + name + " from registry");

            name = NAMING_SERVER_PREFIX + server.getServerID();
            registry.unbind(name);
            log.info("unregistered " + name + " from registry");
         }
         catch(Exception e)
         {
            log.error("Failed to unregister", e);
View Full Code Here

      try
      {
         int serverId = getServerPeer(target).getServerPeerID();

         //First unregister from the RMI registry
         Registry registry = LocateRegistry.getRegistry(RMITestServer.DEFAULT_REGISTRY_PORT);

         String name = RMITestServer.RMI_SERVER_PREFIX + serverId;
         registry.unbind(name);
         log.info("unregistered " + name + " from registry");

         name = RMITestServer.NAMING_SERVER_PREFIX + serverId;
         registry.unbind(name);
         log.info("unregistered " + name + " from registry");

         log.info("#####");
         log.info("#####");
         log.info("##### Halting the server!");
View Full Code Here

    void run() throws IOException, AlreadyBoundException, RemoteException
    {
        store = new SerialObjectStore();
        SRPRemoteServer server = new SRPRemoteServer(store);
        Registry reg = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
        reg.bind("SimpleSRPServer", server);
    }
View Full Code Here

public class EagleManagerClient {

  public static EagleManager getManager(String host, int port, String password) throws RemoteException, NotBoundException {

    Registry registry = LocateRegistry.getRegistry(host,port);

    EagleLogin eagleLogin = (EagleLogin) registry.lookup("eagleLogin");

    return eagleLogin.login(password);
  }
View Full Code Here

    try
    {
      int port = _config.getInt("wrapper.jmx.rmi.port", Constants.DEFAULT_RMI_PORT);
      if (port > 0)
      {
        Registry rmiRegistry = LocateRegistry.createRegistry(port);
        JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + port + "/server");
        Map environment = null;
        if (_config.getString("wrapper.jmx.rmi.user", null) != null)
        {
          final String myUser = _config.getString("wrapper.jmx.rmi.user");
View Full Code Here

                        log.debug("There is an RMI registry bound to given port :" + port);
                    }
                    return;
                }

                Registry locateRegistry = LocateRegistry.createRegistry(port);
                if (locateRegistry == null) {
                    handleException("Unable to create a RMI registry with port : " + port);
                }

                registriesCache.put(key, locateRegistry);
View Full Code Here

                System.err.println(msg);
                System.err.println("Continuing...");
            }
        }
        try {
            Registry reg = LocateRegistry.getRegistry(this.rmiPort);
            reg.rebind(JMETER_ENGINE_RMI_NAME, this);
            log.info("Bound to registry on port " + this.rmiPort);
        } catch (Exception ex) {
            log.error("rmiregistry needs to be running to start JMeter in server " + "mode\n\t" + ex.toString());
            // Throw an Exception to ensure caller knows ...
            throw new RemoteException("Cannot start. See server log file.");
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.