Package javax.naming

Examples of javax.naming.Context.listBindings()


            PrintWriter out = resp.getWriter();

            try {
                Context ctx = new InitialContext();
                NamingEnumeration<Binding> enm =
                    ctx.listBindings("java:comp/env/list");
                while (enm.hasMore()) {
                    Binding b = enm.next();
                    out.print(b.getObject().getClass().getName());
                }
            } catch (NamingException ne) {
View Full Code Here


    protected void assertBinding(Binding binding) throws NamingException {
        Object object = binding.getObject();
        assertTrue("Should have got a child context but got: " + object, object instanceof Context);

        Context childContext = (Context) object;
        NamingEnumeration<Binding> iter = childContext.listBindings("");
        while (iter.hasMore()) {
            Binding destinationBinding = iter.next();
            LOG.info("Found destination: " + destinationBinding.getName());
            Object destination = destinationBinding.getObject();
            assertTrue("Should have a Destination but got: " + destination, destination instanceof Destination);
View Full Code Here

    protected void assertBinding(Binding binding) throws NamingException {
        Object object = binding.getObject();
        assertTrue("Should have got a child context but got: " + object, object instanceof Context);

        Context childContext = (Context) object;
        NamingEnumeration iter = childContext.listBindings("");
        while (iter.hasMore()) {
            Binding destinationBinding = (Binding) iter.next();
            System.out.println("Found destination: " + destinationBinding.getName());
            Object destination = destinationBinding.getObject();
            assertTrue("Should have a Destination but got: " + destination, destination instanceof Destination);
View Full Code Here

        Object destinations = context.lookup("destinations");

        assertTrue("Should have created a destinations context but got: " + destinations, destinations instanceof Context);

        Context destContext = (Context) destinations;
        NamingEnumeration iter = destContext.listBindings("");
        while (iter.hasMore()) {
            Binding binding = (Binding) iter.next();
            System.out.println("Found key: " + binding.getName());
            assertBinding(binding);
        }
View Full Code Here

            final Context context = new InitialContext(props);

            assertNameClassPair(context.list(""));
            assertNameClassPair(context.list("ejb"));

            assertBindings(context.listBindings(""));
            assertBindings(context.listBindings("ejb"));

        } finally {
            serviceDaemon.stop();
            OpenEJB.destroy();
View Full Code Here

            assertNameClassPair(context.list(""));
            assertNameClassPair(context.list("ejb"));

            assertBindings(context.listBindings(""));
            assertBindings(context.listBindings("ejb"));

        } finally {
            serviceDaemon.stop();
            OpenEJB.destroy();
        }
View Full Code Here

            PrintWriter out = resp.getWriter();

            try {
                Context ctx = new InitialContext();
                NamingEnumeration<Binding> enm =
                    ctx.listBindings("java:comp/env/list");
                while (enm.hasMore()) {
                    Binding b = enm.next();
                    out.print(b.getObject().getClass().getName());
                }
            } catch (NamingException ne) {
View Full Code Here

            PrintWriter out = resp.getWriter();

            try {
                Context ctx = new InitialContext();
                NamingEnumeration<Binding> enm =
                    ctx.listBindings("java:comp/env/list");
                while (enm.hasMore()) {
                    Binding b = enm.next();
                    out.print(b.getObject().getClass().getName());
                }
            } catch (NamingException ne) {
View Full Code Here

    protected void assertBinding(Binding binding) throws NamingException {
        Object object = binding.getObject();
        assertTrue("Should have got a child context but got: " + object, object instanceof Context);

        Context childContext = (Context) object;
        NamingEnumeration iter = childContext.listBindings("");
        while (iter.hasMore()) {
            Binding destinationBinding = (Binding) iter.next();
            LOG.info("Found destination: " + destinationBinding.getName());
            Object destination = destinationBinding.getObject();
            assertTrue("Should have a Destination but got: " + destination, destination instanceof Destination);
View Full Code Here

            cursor.dispose();
        }
        environmentEntryBuilder.buildNaming(doc, null, module, componentContext);
        Context context = EnterpriseNamingContext.livenReferences(NamingBuilder.JNDI_KEY.get(componentContext).get(JndiScope.comp), null, null, getClass().getClassLoader(), "comp/");
        Set actual = new HashSet();
        for (NamingEnumeration e = context.listBindings("comp/env"); e.hasMore();) {
            NameClassPair pair = (NameClassPair) e.next();
            actual.add(pair.getName());
        }
        Set expected = new HashSet(Arrays.asList(new String[]{"string", "char", "byte", "short", "int", "long", "float", "double", "boolean", "class", "enum"}));
        assertEquals(expected, actual);
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.