Package javax.naming

Examples of javax.naming.Context.list()


        while ( referralException.skipReferral() )
        {
            try
            {
                Context ctx = referralException.getReferralContext();
                ctx.list( "" ); //$NON-NLS-1$
            }
            catch ( NamingException ne )
            {
                if ( ne instanceof ReferralException )
                {
View Full Code Here


            Properties props = new Properties();
            props.put("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory");
            props.put("java.naming.provider.url", "ejbd://127.0.0.1:" + port);
            Context context = new InitialContext(props);

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

            assertBindings(context.listBindings(""));
            assertBindings(context.listBindings("ejb"));
View Full Code Here

            props.put("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory");
            props.put("java.naming.provider.url", "ejbd://127.0.0.1:" + port);
            Context context = new InitialContext(props);

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

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

        } finally {
View Full Code Here

    public NamingEnumeration<Binding> listBindings(String name) throws NamingException {
        Object o = lookup(name);
        if (o instanceof Context) {
            Context context = (Context) o;
            NamingEnumeration<NameClassPair> enumeration = context.list("");
            List<NameClassPair> bindings = new ArrayList<NameClassPair>();

            while (enumeration.hasMoreElements()) {
                NameClassPair pair = enumeration.nextElement();
                bindings.add(new LazyBinding(pair.getName(), pair.getClassName(), context));
View Full Code Here

        map.put("two", new Integer(2));
        map.put("three", new Integer(3));

        Context context = EnterpriseNamingContext.createEnterpriseNamingContext(map);

        Map result = toListResults(context.list(""));
        assertEquals(4, result.size());
        assertEquals(Integer.class.getName(), result.get("one"));
        assertEquals(Integer.class.getName(), result.get("two"));
        assertEquals(Integer.class.getName(), result.get("three"));
        assertNotNull(result.get("env"));
View Full Code Here

        map.put("a/b/c/d/e/two", new Integer(2));
        map.put("a/b/c/d/e/three", new Integer(3));

        Context context = EnterpriseNamingContext.createEnterpriseNamingContext(map);

        Map result = toListResults(context.list("a/b/c/d/e"));
        assertEquals(3, result.size());
        assertEquals(Integer.class.getName(), result.get("one"));
        assertEquals(Integer.class.getName(), result.get("two"));
        assertEquals(Integer.class.getName(), result.get("three"));
View Full Code Here

        Context nestedContext = (Context) context.lookup("a/b/c");
        assertNotNull(nestedContext);
        assertEquals("a/b/c", nestedContext.getNameInNamespace());

        result = toListResults(nestedContext.list("d/e"));
        assertEquals(3, result.size());
        assertEquals(Integer.class.getName(), result.get("one"));
        assertEquals(Integer.class.getName(), result.get("two"));
        assertEquals(Integer.class.getName(), result.get("three"));
View Full Code Here

            final ParsedName parsedName = parse(name);
            final Context namespaceContext = findContext(name, parsedName);
            if (namespaceContext == null)
                return super.list(parsedName.remaining());
            else
                return namespaceContext.list(parsedName.remaining());
        }

        public void bind(Name name, Object object) throws NamingException {
            final ParsedName parsedName = parse(name);
            final Context namespaceContext = findContext(name, parsedName);
View Full Code Here

        try {
            return namingEnumeration(namingStore.list(getAbsoluteName(name)));
        } catch(CannotProceedException cpe) {
            final Context continuationContext = NamingManager.getContinuationContext(cpe);
            return continuationContext.list(cpe.getRemainingName());
        catch (RequireResolveException r) {
            final Object o = lookup(r.getResolve());
            if (o instanceof Context) {
                return ((Context)o).list(name.getSuffix(r.getResolve().size()));
            }
View Full Code Here

        dns.add(deleteFromDn);

        while (!dns.isEmpty()) {
            String name = dns.get(dns.size() - 1);
            Context currentContext = (Context) context.lookup(name);
            NamingEnumeration<NameClassPair> namingEnum = currentContext.list("");

            if (namingEnum.hasMore()) {
                while (namingEnum.hasMore()) {
                    dns.add(namingEnum.next().getNameInNamespace());
                }
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.