Package java.rmi.registry

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


                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


    } catch (RemoteException ex){
      ex.printStackTrace();
      if (create) {
        System.out.println("No registry found. Creating one.");
        Registry r = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
        r.rebind(name, obj);
      } else throw ex;
    }
  }
 
  /** Main method.
View Full Code Here

      Naming.rebind (name, obj);
    } catch (RemoteException ex){
      if (create) {
        ex.printStackTrace ();
        Registry r = LocateRegistry.createRegistry (Registry.REGISTRY_PORT);
        r.rebind (name, obj);
      } else throw ex;
    }
  }
 
  /** Main method.
View Full Code Here

   
    lockbox.put ("MyJob", new Object ());
   
    ResultChannel resultChannel = new ResultChannelImpl (lockbox);
    Registry r = LocateRegistry.createRegistry (ResultChannel.PORT);
    r.rebind (ResultChannel.LOOKUP_NAME, resultChannel);
  }
 
  /** Constructs ResultChannelImpl object and exports it on default port.
   * @param lockbox the Map holding the job locks.
   * @throws RemoteException if an error occurs on the server side
View Full Code Here

    //Prepare the return data channel
    log.log (Level.FINEST, "Registering ResultChannel");
    try {
      resultChannel = new ResultChannelImpl (lockbox);
      Registry r = LocateRegistry.createRegistry (ResultChannel.PORT);
      r.rebind (ResultChannel.LOOKUP_NAME, resultChannel);
    }
    catch (RemoteException e) {
      log.severe ("Unable to establish return data channel: " + e.getMessage ());
      log.throwing ("com.sun.grid.jgrid.proxy.ComputeProxy", "main", e);
     
View Full Code Here

      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

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

      log.debug("Binding registry to " + "remoting/RMIServerInvoker/" + bindPort);
      registry.rebind("remoting/RMIServerInvoker/" + bindPort, this);

      unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), this.getClass().getClassLoader());
      marshaller = MarshalFactory.getMarshaller(getLocator(), this.getClass().getClassLoader());
   }
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, this);

      unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), this.getClass().getClassLoader());
      marshaller = MarshalFactory.getMarshaller(getLocator(), this.getClass().getClassLoader());
   }
View Full Code Here

                {   //need to start rmiregistry
                    System.out.println("registry not found");
                    Thread.yield();
                }
            }
            registry.rebind(SmartCardTaskProcessor.registryId, stub);
            System.out.println("Terminal Manager bound");

            System.out.println("wait for task or command");

        } catch (Exception ex) {
View Full Code Here

           
      Registry registry = MiscUtils.initRMIServer(1099);
     
      // Ensure compliancy with previous JVM versions.
      GameServer stub = (GameServer) UnicastRemoteObject.exportObject(serverInstance);
      registry.rebind(STUB_NAME, stub);
           
      System.out.println("Game daemon started !");
           
      return true;
    }
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.