Package javax.naming

Examples of javax.naming.Context.listBindings()


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

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


            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

            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

            cursor.dispose();
        }
        environmentEntryBuilder.buildNaming(doc, null, null, componentContext);
        Context context = EnterpriseNamingContext.createEnterpriseNamingContext(NamingBuilder.JNDI_KEY.get(componentContext));
        Set actual = new HashSet();
        for (NamingEnumeration e = context.listBindings("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"}));
        assertEquals(expected, actual);
View Full Code Here

            cursor.dispose();
        }
        environmentEntryBuilder.buildNaming(doc, plan, null, componentContext);
        Context context = EnterpriseNamingContext.createEnterpriseNamingContext(NamingBuilder.JNDI_KEY.get(componentContext));
        Set actual = new HashSet();
        for (NamingEnumeration e = context.listBindings("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"}));
        assertEquals(expected, actual);
View Full Code Here

    }
    assertTrue("Correct Integer registered", context3.lookup("myinteger") == i);
    assertTrue("Correct String registered", context3.lookup("mystring") == s);

    Map<String, Binding> bindingMap = new HashMap<String, Binding>();
    NamingEnumeration<?> bindingEnum = context3.listBindings("");
    while (bindingEnum.hasMoreElements()) {
      Binding binding = (Binding) bindingEnum.nextElement();
      bindingMap.put(binding.getName(), binding);
    }
    assertTrue("Correct jdbc subcontext", bindingMap.get("jdbc").getObject() instanceof Context);
View Full Code Here

    assertTrue("Correct jdbc subcontext", SimpleNamingContext.class.getName().equals(bindingMap.get("jdbc").getClassName()));

    Context jdbcContext = (Context) context3.lookup("jdbc");
    jdbcContext.bind("mydsX", ds);
    Map<String, Binding> subBindingMap = new HashMap<String, Binding>();
    NamingEnumeration<?> subBindingEnum = jdbcContext.listBindings("");
    while (subBindingEnum.hasMoreElements()) {
      Binding binding = (Binding) subBindingEnum.nextElement();
      subBindingMap.put(binding.getName(), binding);
    }
View Full Code Here

      }
      catch (CannotProceedException cpe)
      {
         cpe.setEnvironment(refEnv);
         Context cctx = NamingManager.getContinuationContext(cpe);
         return cctx.listBindings(cpe.getRemainingName());
      }
      catch (IOException e)
      {
         naming = null;
         removeServer(refEnv);
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

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.