Package java.rmi.registry

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


            locator.setHomeInUse(home);
            storeLocalConfig(configuration);
            log.debug(this + " looking up registry: " + host + "," + port);
            Registry registry = LocateRegistry.getRegistry(host, registryPort);
            log.debug(this + " trying to connect to: " + home);
            Remote remoteObj = registry.lookup("remoting/RMIServerInvoker/" + port);
            log.debug("Remote RMI Stub: " + remoteObj);
            setServerStub((RMIServerInvokerInf) remoteObj);
            connected = true;
            break;
         }
View Full Code Here


    GameServer gameServer = null;
   
    try
    {
      Registry registry = LocateRegistry.getRegistry(serverHost);
      gameServer = (GameServer) registry.lookup(GameServer.STUB_NAME);
    }
    catch (Throwable t)
    {
      JOptionPane.showMessageDialog(this, GUIMessages.UNABLE_TO_CONNECT_TO_SERVER_MESSAGE + t.getMessage(), GUIMessages.ERROR_TEXT.toString(), JOptionPane.ERROR_MESSAGE);
      t.printStackTrace();
View Full Code Here

  {
    if (GameServerImpl.startDaemon(false))
    {
      Registry registry = LocateRegistry.getRegistry("127.0.0.1");
     
      GameServer gameServer = (GameServer) registry.lookup(GameServer.STUB_NAME);
     
      HumanGameClient playerClient = new HumanGameClient(gameServer, gameServer.getTicket(), "Julek");
      playerClient.addObserver(new SimpleObserver());
      new Thread(playerClient).start();
      new Thread(new AIGameClient(gameServer, gameServer.getTicket(), "bougo", new DefaultEvalScore(), 4)).start();
View Full Code Here

  {
    if (startDaemon(true))
    {
      Registry registry = LocateRegistry.getRegistry("127.0.0.1");
     
      GameServer gameServer = (GameServer) registry.lookup(STUB_NAME);
     
      GameClient firstClient = new AIGameClient(gameServer, gameServer.getTicket(), "bougo", new DefaultEvalScore(), 4);
     
      new Thread(firstClient).start();
      new Thread(new AIGameClient(gameServer, gameServer.getTicket(), "bougoéland", new DefaultEvalScore(), 4)).start();
View Full Code Here

    try
    {
      globalServer.createGame(gameName);
     
      Registry registry = LocateRegistry.getRegistry(remoteServerAddress);
      gameServer = (GameServer) registry.lookup(GlobalServer.SINGLE_GAME_SERVER_STUB_PREFIX + gameName);
     
    }
    catch (RemoteException e)
    {
      JOptionPane.showMessageDialog(this, GUIMessages.UNABLE_TO_CONNECT_TO_SERVER_MESSAGE + e.getMessage(), GUIMessages.ERROR_TEXT.toString(), JOptionPane.ERROR_MESSAGE);
View Full Code Here

    GameServer gameServer = null;
   
    try
    {
      Registry registry = LocateRegistry.getRegistry(remoteServerAddress);
      gameServer = (GameServer) registry.lookup(GlobalServer.SINGLE_GAME_SERVER_STUB_PREFIX + gameName);
     
      if (gameServer.getPlayers().size() == PlayerMark.getNumberOfPlayerMarks())
      {
        JOptionPane.showMessageDialog(this, GUIMessages.THE_SELECTED_GAME_IS_FULL, GUIMessages.ERROR_TEXT.toString(), JOptionPane.ERROR_MESSAGE);       
        return;
View Full Code Here

        try {
            registry = rmiRegistries.get(Integer.toString(rmiURI.port));
            if (registry == null) {
                try {
                    registry = LocateRegistry.getRegistry(rmiURI.port);
                    registry.lookup(rmiURI.serviceName);
                } catch (RemoteException e) {
                    registry = LocateRegistry.createRegistry(rmiURI.port);
                } catch (NotBoundException e) {
                    // Ignore
                }
View Full Code Here

            // Requires permission java.net.SocketPermission "host:port", "connect,accept,resolve"
            // in security policy.
            Registry registry = LocateRegistry.getRegistry(rmiURI.host, rmiURI.port);

            if (registry != null) {
                remoteService = registry.lookup(rmiURI.serviceName);
            }
        } catch (RemoteException e) {
            RMIHostRuntimeException rmiExec = new RMIHostRuntimeException(e.getMessage());
            rmiExec.setStackTrace(e.getStackTrace());
            throw rmiExec;
View Full Code Here

            startDefaultCardManager();
            registry = LocateRegistry.getRegistry(serverAddress);*/
        }
        try {

            reader = (SmartCardTaskProcessor) registry.lookup(SmartCardTaskProcessor.registryId);
            reader.exist();//if card reader manager is not running, this will throw an exception
            } catch (Exception ex) {
            System.out.println("Exception: " + ex.getMessage());
            System.out.println("start default card manager\n");
            startDefaultCardManager();
View Full Code Here

            } catch (Exception ex) {
            System.out.println("Exception: " + ex.getMessage());
            System.out.println("start default card manager\n");
            startDefaultCardManager();
            try {
                reader = (SmartCardTaskProcessor) registry.lookup(SmartCardTaskProcessor.registryId);
            } catch (RemoteException ex1) {
                Logger.getLogger(Utilities.class.getName()).log(Level.SEVERE, null, ex1);
            } catch (NotBoundException ex1) {
                Logger.getLogger(Utilities.class.getName()).log(Level.SEVERE, null, ex1);
            }
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.