Package java.rmi.registry

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


    public void init() throws RemoteException {
        if (registry == null && locate) {
            try {
                Registry reg = LocateRegistry.getRegistry(getPort());
                reg.list();
                registry = reg;
            } catch (RemoteException e) {
                // ignore
            }
        }
View Full Code Here


        Registry registry = LocateRegistry.getRegistry(registryPort);

        // before we stop the context the registry is still exported, so list() should work
        Exception e;
        try {
            registry.list();
            e = null;
        } catch (NoSuchObjectException nsoe) {
            e = nsoe;
        }
        assertNull(e);
View Full Code Here

        context.stop();

        // stopping the Camel context unexported the registry, so list() should fail
        Exception e2;
        try {
            registry.list();
            e2 = null;
        } catch (NoSuchObjectException nsoe) {
            e2 = nsoe;
        }
        assertNotNull(e2);
View Full Code Here

                // we're in a web-app being 'hot' re-depoloyed, then the JVM
                // still
                // has the registry that we created above the first time...
                registry = LocateRegistry.getRegistry(resources
                        .getRMIRegistryPort());
                registry.list();
            } catch (Exception e) {
                registry = LocateRegistry.createRegistry(resources
                        .getRMIRegistryPort());
            }
        } else if (resources.getRMICreateRegistryStrategy().equals(
View Full Code Here

                           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));
        if (list.length != 1 || !list[0].equals(NAME)) {
            throw new RuntimeException(
                "TEST FAILED: unexpected list contents");
View Full Code Here

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

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

        Registry registryImpl = LocateRegistry.createRegistry(PORT);
        CSF csf = new CSF();
        Reference<CSF> registryRef = new WeakReference<CSF>(csf);
        Registry registryStub = LocateRegistry.getRegistry("", PORT, csf);
        csf = null;
        registryStub.list();
        registryStub = null;
        UnicastRemoteObject.unexportObject(registryImpl, true);

        System.gc();
        // allow connections to time out
View Full Code Here

            System.err.println("\ntesting form: " + s);

            try {
                Naming.rebind(s, legal);
                names = registry.list();

                // ensure that the name in the registry is what is expected
                if ((names.length > 0) &&
                    (names[0].compareTo("MyName") != 0))
                {
View Full Code Here

    public Hashtable probeRegistry(int port) throws RemoteException,
            NotBoundException {
        Hashtable table = new Hashtable();
        Registry r = LocateRegistry.getRegistry(port);
        String s[] = r.list();

        for (int i = 0; i < s.length; i++) {
            Remote robj = r.lookup(s[i]);
            Class cl = robj.getClass();
            Field f[] = cl.getDeclaredFields();
View Full Code Here

    public void afterPropertiesSet() throws RemoteException {
        if (registry == null && locate) {
            try {
                Registry reg = LocateRegistry.getRegistry(getPort());
                reg.list();
                registry = reg;
            } catch (RemoteException e) {
                // ignore
            }
        }
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.