Package java.rmi.registry

Examples of java.rmi.registry.Registry


      if (i == GET_SERVER_MAX_RETRIES) {
    done = true;
      }
      try {
    if (!noRmi) {
        Registry registry = LocateRegistry.getRegistry(
      serverHost, serverPort);
        return (DataStoreServer) registry.lookup(
      "DataStoreServer");
    } else {
        return new DataStoreClientRemote(serverHost, serverPort);
    }
      } catch (IOException e) {
View Full Code Here


                }
    serverPort = wrappedProps.getIntProperty(
        SERVER_PORT_PROPERTY, DEFAULT_SERVER_PORT, 1, 65535);
      }

      Registry rmiRegistry = LocateRegistry.getRegistry(host, serverPort);
      serverProxy = (WatchdogServer)
    rmiRegistry.lookup(WatchdogServerImpl.WATCHDOG_SERVER_NAME);

            int jmxPort = wrappedProps.getIntProperty(
                    StandardProperties.SYSTEM_JMX_REMOTE_PORT, -1);
            if (startServer) {
                localNodeId = serverImpl.localNodeId;
View Full Code Here

    return bound?1:0;
  }

  private static Object callPrologServer(String host,String portName,Object goal)
      throws ConnectException,NotBoundException,AccessException,RemoteException {
    Registry registry=LocateRegistry.getRegistry(host);
    PrologService stub=(PrologService)registry.lookup(portName);
    return stub.serverCallProlog(goal);
  }
View Full Code Here

      System.out.println("slept for:"+secs);
  }

  public static Object clientPrologCall(String host,String portName,Object goal) {
    try {
      Registry registry=LocateRegistry.getRegistry(host);
      PrologService stub=(PrologService)registry.lookup(portName);
      Object answer=stub.serverCallProlog(goal);
      return answer;
    } catch(Exception e) {

      System.err.println("rli_call error: "+e+",port="+portName+",CALLING=>"+goal);
View Full Code Here

    }
  }

  public static Object rli_in(String host,String portName) {
    try {
      Registry registry=LocateRegistry.getRegistry(host);
      PrologService stub=(PrologService)registry.lookup(portName);
      Object answer=stub.rli_in();
      return answer;
    } catch(Exception e) {
      System.err.println("Error in rli_in: "+e.toString()+",port="+portName);
      if(RLIAdaptor.trace)
View Full Code Here

    }
  }

  public static void rli_out(String host,String portName,Object T) {
    try {
      Registry registry=LocateRegistry.getRegistry(host);
      PrologService stub=(PrologService)registry.lookup(portName);
      stub.rli_out(T);
    } catch(Exception e) {
      System.err.println("Error in rli_out: "+e.toString()+",port="+portName+",term="+T);
      if(RLIAdaptor.trace)
        e.printStackTrace();
View Full Code Here

    try { // ?? maybe the stub needs to be returned?
      PrologService stub=(PrologService)UnicastRemoteObject
          .exportObject(this,0);

      // (Re)Bind the remote object's stub in the registry
      Registry registry=LocateRegistry.getRegistry();
      registry.rebind(this.portName,stub);

      // System.err.println("Starting Server: " + this.portName);
    } catch(Exception e) {
      System.err.println("Server start exception: "+e.toString()+",port="+portName);
      if(RLIAdaptor.trace)
View Full Code Here

   */

  public boolean bg_stop() {
    System.err.println("Stopping Server: "+this.portName);
    try {
      Registry registry=LocateRegistry.getRegistry();
      registry.unbind(this.portName);
      return UnicastRemoteObject.unexportObject(this,true);
    } catch(Exception e) {
      System.err.println("Server stop exception: "+e.toString());
      e.printStackTrace();
      return false;
View Full Code Here

  }
 
  public ExternalRemoteServerContext login(String username, String password)
      throws RemoteException, LoginException {
    System.setSecurityManager(null);
    Registry registry = LocateRegistry.getRegistry(server, port);
    try {
      cspokerServer = (ExternalRemoteCSPokerServer) registry.lookup("CSPokerServer");
    } catch (NotBoundException exception) {
      throw new RemoteException("CSPokerServer not found in registry.", exception);
    }
    ExternalRemoteServerContext context = cspokerServer.login(username, password);
    return new ServerContextStub(context);
View Full Code Here

        endpoint.getRemoteInterfaces().toArray(interfaces);
        proxy = (Remote)Proxy.newProxyInstance(endpoint.getClassLoader(), interfaces, this);
        stub = UnicastRemoteObject.exportObject(proxy, endpoint.getPort());

        try {
            Registry registry = endpoint.getRegistry();
            String name = endpoint.getName();
            registry.bind(name, stub);

        } catch (Exception e) { // Registration might fail.. clean up..
            try {
                UnicastRemoteObject.unexportObject(stub, true);
            } catch (Throwable ignore) {
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.