Package java.rmi.registry

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


    RMISecurityManager security = new RMISecurityManager();
    System.setSecurityManager(security);
    ServerTaskAPI server = new ServerTaskAPI();
    Registry registry = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
    registry.rebind(rmi_name, server);

    System.out.println("Server (rmi://" + hostname + ":" + port + "/" + rmi_name + ") ready...");
  }

}
View Full Code Here


         String name = "//" + host + "/RMIServer";

         RMIServerRemote engine = new RMIServer(host);
//         Naming.rebind(name, engine);
         registry.rebind(name, this);
         System.out.println("RMIServer bound");
      }
      catch(Exception e)
      {
         System.err.println("RMIServer exception: " + e.getMessage());
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());
      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);

      Map map = passConfigMapToMarshalFactory ? configuration : null;
      unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), this.getClass().getClassLoader(), map);
      marshaller = MarshalFactory.getMarshaller(getLocator(), this.getClass().getClassLoader(), map);
   }
View Full Code Here

                    String host = (InetAddress.getLocalHost()).toString();
                    logger.info("address=" + host + " port=" + config.getRMIPort());
                    CommunicationService stub = (CommunicationService) UnicastRemoteObject.
                            exportObject(RMIServer.this, config.getRMIPort());
                    Registry registry = LocateRegistry.createRegistry(config.getRMIPort());
                    registry.rebind(config.getRMIService(), stub);
                } catch (Exception ex) {
                    throw new RuntimeException(ex);
                }
            }
        };
View Full Code Here

                System.err.println("Continuing...");
            }
        }
        try {
            Registry reg = LocateRegistry.getRegistry(port);
            reg.rebind(JMETER_ENGINE_RMI_NAME, this);
            log.info("Bound to registry on port " + port);
        } 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

                    .getRMIRegistryHost(), resources.getRMIRegistryPort());
        }

        String bindName = resources.getRMIBindName();
       
        registry.rebind(bindName, exportable);
       
        boundRemotely = true;

        getLog().info("Scheduler bound to RMI registry under name '" + bindName + "'");
    }
View Full Code Here

                } catch (RemoteException e) {
                    registry = LocateRegistry.createRegistry(port);
                }
                rmiRegistries.put(Integer.toString(port), registry);
            }
            registry.rebind(serviceName, serviceObject);
        } catch (RemoteException e) {
            RMIHostRuntimeException rmiExec = new RMIHostRuntimeException(e.getMessage());
            rmiExec.setStackTrace(e.getStackTrace());
            throw rmiExec;
        }
View Full Code Here

            System.out.println("Activation descriptor registered: " + stub);

            Registry reg = LocateRegistry.getRegistry();
            System.out.println("Registry = " + reg);

            reg.rebind("HelloImpl_Stub", stub);
            System.out.println("Stub bound in registry.");
        } catch (Throwable t) {
            System.out.println("Exception in HelloInstaller: " + t);
            t.printStackTrace();
            fail("Exception in HelloInstaller: " + t);
View Full Code Here

    try {
      Registry reg = LocateRegistry.getRegistry(port);
      hostName = InetAddress.getLocalHost().getHostName();
      log.info("Creating JMeter engine on host "+hostName);
      backingEngine = new StandardJMeterEngine(hostName);// see setHost()
      reg.rebind("JMeterEngine", this); // $NON-NLS-1$
      log.info("Bound to registry on port " + port);
    } 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
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.