Package java.rmi.registry

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


            System.err.println("bind remote object in registries");
            Registry registry1 = LocateRegistry.getRegistry(2030);
            Registry registry2 = LocateRegistry.getRegistry(2040);

            registry1.bind(NAME, proxy);
            registry2.bind(NAME, proxy);

            System.err.println("lookup remote object in registries");

            RemoteInterface remote1 = (RemoteInterface) registry1.lookup(NAME);
            RemoteInterface remote2 = (RemoteInterface) registry2.lookup(NAME);
View Full Code Here


            Registry localRegistry =
                LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
            System.err.println("created local registry");

            localRegistry.bind(BINDING, obj);
            System.err.println("bound remote object in local registry");

            synchronized (obj.lock) {
                System.err.println("starting remote client VM...");
                (new JavaVM("SelfTerminator")).start();
View Full Code Here

                        new TCPEndpoint("", PORT), false));
        Registry referenceStub = new ReferenceRegistryStub(ref);
        System.err.println("created reference registry stub: " +
                           referenceStub);

        referenceStub.bind(NAME, referenceStub);
        System.err.println("bound name \"" + NAME + "\" in registry");

        String[] list = referenceStub.list();
        System.err.println("list of registry contents: " +
                           Arrays.asList(list));
View Full Code Here

        System.err.println("created new instrumented test registry stub: " +
                           testStub);

        System.err.println("invoking bind:");
        try {
            testStub.bind(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

            obj = new CallbackImpl();
            Callback proxy =
                (Callback) UnicastRemoteObject.exportObject(obj, 0);
            Registry registry =
                LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
            registry.bind("Callback", proxy);

            /*
             * Start rmid.
             */
            System.err.println("start rmid with inherited channel");
View Full Code Here

            obj = new RmidViaInheritedChannel();
            Callback proxy = (Callback)
                UnicastRemoteObject.exportObject(obj, 0);
            Registry registry =
                LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
            registry.bind("Callback", proxy);

            /*
             * Start rmid.
             */
            System.err.println("start rmid with inherited channel");
View Full Code Here

            Registry localRegistry =
                LocateRegistry.createRegistry(TestLibrary.REGISTRY_PORT);
            System.err.println("created local registry");

            localRegistry.bind(BINDING, obj);
            System.err.println("bound shutdown monitor in local registry");

            System.err.println("starting remote ShutdownImpl VM...");
            (new JavaVM("ShutdownImpl")).start();
View Full Code Here

            case SERVER:
                try {
                    Registry reg = LocateRegistry.createRegistry(port);
                    serverImpl = new BenchServerImpl();
                    reg.bind(REGNAME, serverImpl);
                } catch (Exception e) {
                    die("Error: failed to initialize server: " + e);
                }
                if (verbose) {
                    System.out.println("Benchmark server started on port " +
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.bind(url.name, obj);
    }

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

            logger.debug("Binding " + obj.toString() + " to name '"+ bindingName + "'");

            final Remote remote = UnicastRemoteObject.exportObject(obj, 0,
                naming.getSocketFactory(), naming.getSocketFactory());
            try {
                registry.bind(bindingName, remote);
            } catch (AlreadyBoundException e) {
                logger.warn("RMI binding '" + bindingName + "' is already bound. Proceeding.");
            }

            if (first) {
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.