Package java.rmi.registry

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


    } catch (Exception e) {
      Logger.error("RMI unexporting");
    }
    $HY$_INode stub = ($HY$_INode) UnicastRemoteObject.exportObject(this, 0);
    // Bind the remote object's stub in the registry
    registry.rebind(Node.class.getName(), stub);
    Logger.debug("RMI stub inited");
    locator = HyFlow.getLocator();
    }
   
  @Override
View Full Code Here


    } catch (Exception e) {
      Logger.error("RMI unexporting");
    }
    $HY$_INode stub = ($HY$_INode) UnicastRemoteObject.exportObject(this, 0);
    // Bind the remote object's stub in the registry
    registry.rebind(Node.class.getName(), stub);
    Logger.debug("RMI stub inited");
    locator = HyFlow.getLocator();
    }
   
  @Override
View Full Code Here

    } catch (Exception e) {
      Logger.error("RMI unexporting");
    }
    $HY$_ISearchAgent stub = ($HY$_ISearchAgent) UnicastRemoteObject.exportObject(this, 0);
    // Bind the remote object's stub in the registry
    registry.rebind(SearchAgent.class.getName(), stub);
//    Logger.info("RMI stub inited");
    locator = HyFlow.getLocator();
    }

  @Override
View Full Code Here

   
    IglobalCeiling stub = (IglobalCeiling) UnicastRemoteObject.exportObject(this, 0);

    // Bind the remote object's stub in the registry
    Registry registry = LocateRegistry.getRegistry(Network.getInstance().getPort());
    registry.rebind(this.id, stub);
   
    gCeiling = null;
  }
 
  public Timespec getCeiling() {
View Full Code Here

    try {
      ncs = new NumberCruncherServer();
      logger.info("Creating registry.");

      Registry registry = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
      registry.rebind("Factor", ncs);
      logger.info("NumberCruncherServer bound and ready.");
    } catch (Exception e) {
      logger.error("Could not bind NumberCruncherServer.", e);

      return;
View Full Code Here

            RmiDelegateUserbase userbaseStub = (RmiDelegateUserbase) UnicastRemoteObject.exportObject(rmidus, Integer.parseInt(p.getProperty("userbase.port", "0")), csf, ssf);
            //registry.rebind("userbase", userbaseStub);
            // maybe binding the rmidus instead of the stub keeps it from being GCed (http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=4&t=002159)
            // changed to export the right object to prevent it from being garbage collected (i.e. don't export the stub)
            registry.rebind("userbase", rmidus);

            // STATISTICS
            rmiuss = new RmiUserStatisticsServer(new LocalUserStatistics(new File(dataDirectory, "/logs/userstatistics")));
            RmiUserStatistics statisticsStub = (RmiUserStatistics) UnicastRemoteObject.exportObject(rmiuss, Integer.parseInt(p.getProperty("statistics.port", "0")), csf, ssf);
            //registry.rebind("statistics", statisticsStub);
View Full Code Here

            // STATISTICS
            rmiuss = new RmiUserStatisticsServer(new LocalUserStatistics(new File(dataDirectory, "/logs/userstatistics")));
            RmiUserStatistics statisticsStub = (RmiUserStatistics) UnicastRemoteObject.exportObject(rmiuss, Integer.parseInt(p.getProperty("statistics.port", "0")), csf, ssf);
            //registry.rebind("statistics", statisticsStub);
            // changed to export the right object to prevent it from being garbage collected (i.e. don't export the stub)
            registry.rebind("statistics", rmiuss);

            System.out.println("Remote userbase and statistics started " + getVersion()); // maybe this could be cleaner, but at least this way we don't have to instantiate the server class, but we can override it nicely in cubnc
        } catch (AccessException e) {
            System.err.println("Permission exception: " + e.getMessage());
        } catch (FileNotFoundException e) {
View Full Code Here

      RMIServerSocketFactory ssf = new RemotingRMIServerSocketFactory(getServerSocketFactory(), BACKLOG_DEFAULT, bindHost, getTimeout());
      csf = getRMIClientSocketFactory(clientConnectHost);
      stub = UnicastRemoteObject.exportObject(this, bindPort, csf, ssf);

      log.debug("Binding server to \"remoting/RMIServerInvoker/" + bindPort + "\" in registry");
      registry.rebind("remoting/RMIServerInvoker/" + bindPort, RMIServerInvoker.this);
      ClassLoader classLoader = SecurityUtility.getClassLoader(RMIServerInvoker.class);
      unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), classLoader);
      marshaller = MarshalFactory.getMarshaller(getLocator(), classLoader);
   }
View Full Code Here

        } else {
            registry = LocateRegistry.getRegistry(resources
                    .getRMIRegistryHost(), resources.getRMIRegistryPort());
        }

        registry.rebind(resources.getUniqueIdentifier(), exportable);

        getLog().info("Scheduler bound to RMI registry.");
    }

    /**
 
View Full Code Here

      ManagerToMaster master = (ManagerToMaster) Naming.lookup("//"
          + masterServer + "/" + ManagerToMaster.SERVICE_NAME);
      WorkerManagerImpl mgr = new WorkerManagerImpl(master,
          vertexClassName);
      Registry registry = LocateRegistry.createRegistry(PORT_NUMBER);
      registry.rebind(mgr.getId(), mgr);
      System.out.println("Worker manager registered as " + mgr.getId()
          + " in port : " + PORT_NUMBER);
      master.register(mgr, mgr.getId());
      System.out.println("Worker Manager registered to master");
    } catch (RemoteException e) {
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.