Package javax.naming

Examples of javax.naming.Context.listBindings()


        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


    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

  /**  
         * Enumerates the names bound in the named context, along with the objects bound to them.
         */  
  public NamingEnumeration listBindings(Name name) throws NamingException {
    Context ctx = getImpl();
    return ctx.listBindings(name);
  }


  /**  
         * Enumerates the names bound in the named context, along with the objects bound to them.
View Full Code Here

  /**  
         * Enumerates the names bound in the named context, along with the objects bound to them.
         */  
  public NamingEnumeration listBindings(String name) throws NamingException {
    Context ctx = getImpl();
    return ctx.listBindings(name);
  }


  /**  
         * Retrieves the named object.
View Full Code Here

            return listBindings(name.get(0));
        }
        Context context = getContinuationContext(name);

        try {
            return context.listBindings(name.getSuffix(1));
        } finally {
            context.close();
        }
    }
View Full Code Here

    public NamingEnumeration<Binding> listBindings(String name) throws NamingException {
        ResolveResult result = getRootURLContext(name, environment);
        Context context = (Context) result.getResolvedObj();

        try {
            return context.listBindings(result.getRemainingName());
        } finally {
            context.close();
        }
    }
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

            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

            return listBindings(name.get(0));
        }
        Context context = getContinuationContext(name);

        try {
            return context.listBindings(name.getSuffix(1));
        } finally {
            context.close();
        }
    }
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.