Package java.rmi.registry

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


            reg = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
        } catch (Exception ex) {
            reg = LocateRegistry.getRegistry();
        }
        for (int i = 0; i < names.length; i++) {
            reg.rebind(names[i], reg);
            Naming.lookup("rmi://localhost/" + names[i]);
        }
    }
}
View Full Code Here


        try {
            HostVerifyingSocketFactory hvf = new HostVerifyingSocketFactory();
            RMISocketFactory.setSocketFactory(hvf);
            Registry r = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
            t = new UnderscoreHost();
            r.rebind(NAME, t);
            Naming.lookup("rmi://" + HOSTNAME +
                          ":" + Registry.REGISTRY_PORT + "/" + NAME);
            /*
             * This test is coded to pass whether java.net.URI obeys
             * RFC 2396 or RFC 3986 (see 5085902, 6394131, etc.).
View Full Code Here

            try {
                reg = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
            } catch (Exception ex) {
                reg = LocateRegistry.getRegistry();
            }
            reg.rebind("foo", reg);
            Naming.lookup("rmi://[" + localAddr.getHostAddress() + "]/foo");
        }
    }
}
View Full Code Here

            throw new RuntimeException("TEST FAILED: wrong operation number");
        }

        System.err.println("invoking rebind:");
        try {
            testStub.rebind(NAME, referenceStub);
        } catch (UnsupportedOperationException e) {
        }
        System.err.println("hash == " + f.hash + ", opnum == " + f.opnum);
        if (f.hash != 4905912898345647071L) {
            throw new RuntimeException("TEST FAILED: wrong interface hash");
View Full Code Here

            TestLibrary.bomb(e);
        }

        try {

            registry.rebind( NAME, new HttpSocketTest() );
            MyRemoteInterface httpTest =
                (MyRemoteInterface)Naming.lookup( REGNAME );
            httpTest.setRemoteObject( new HttpSocketTest() );
            Remote r = httpTest.getRemoteObject();
View Full Code Here

        public static void main(String[] args) throws Exception {
            LocateRegistry.createRegistry(PORT);
            Registry reg = LocateRegistry.getRegistry("", PORT);
            FooImpl fooimpl = new FooImpl();
            UnicastRemoteObject.exportObject(fooimpl, 0);
            reg.rebind("foo", fooimpl);
            Foo foostub = (Foo) reg.lookup("foo");
            FooImpl fooimpl2 = new FooImpl();
            UnicastRemoteObject.exportObject(fooimpl2, 0);
            foostub.echo(fooimpl2);
            UnicastRemoteObject.unexportObject(fooimpl, true);
View Full Code Here

      RMIServerSocketFactory ssf = new RemotingRMIServerSocketFactory(getServerSocketFactory(), BACKLOG_DEFAULT, bindHost, getTimeout());
      RMIClientSocketFactory csf = new RemotingRMIClientSocketFactory(getSocketFactory(), clientConnectHost, getTimeout());
      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

            // rmi.00=URL could not be null.
            throw new NullPointerException(Messages.getString("rmi.00")); //$NON-NLS-1$
        }
        RegistryURL url = getRegistryURL(name, false);
        Registry reg = LocateRegistry.getRegistry(url.host, url.port);
        reg.rebind(url.name, obj);
    }

    public static void unbind(String name) throws RemoteException, NotBoundException,
            MalformedURLException {
        if (name == null) {
View Full Code Here

  public ServerImpl(int port, String name, boolean testMode) {
    try {
      System.setSecurityManager(null);
      Registry reg = LocateRegistry.createRegistry(port);
      Server stub = (Server) UnicastRemoteObject.exportObject(this, port);
      reg.rebind(name, stub);
      this.testMode = testMode;
      logger.info("Started MAGE server - listening on port " + port);
      if (testMode)
        logger.info("MAGE server running in test mode");
    } catch (ExportException ex) {
View Full Code Here

  private void startInvoker(String name) throws ServletException, RemoteException {
    Registry myReg = getRegistry(PORT);
    CLIInvokerImpl invoker=new CLIInvokerImpl(root, servletName);
    CLIInvoker stub = (CLIInvoker) UnicastRemoteObject.exportObject( invoker, 0 );
    myReg.rebind( name, stub );
    if(idleTime>0){
      Closer closer = new Closer(myReg,invoker,name,idleTime);
      closer.setDaemon(false);
      closer.start();
    }
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.