Examples of listBindings()


Examples of javax.naming.Context.listBindings()

            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

Examples of javax.naming.Context.listBindings()

            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

Examples of javax.naming.Context.listBindings()

            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

Examples of javax.naming.Context.listBindings()

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

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

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

Examples of javax.naming.Context.listBindings()

            while( entries.hasNext() )
            {
                Map.Entry entry = ( Map.Entry ) entries.next();
                context.bind( ( String ) entry.getKey(), entry.getValue() );
            }
            NamingEnumeration bindings = context.listBindings( "" );
            while( bindings.hasMore() )
            {
                Binding binding = ( Binding ) bindings.nextElement();
                String name = binding.getName();
                Object expected = map.get( name );
View Full Code Here

Examples of javax.naming.Context.listBindings()

        }
        else
        {
            // Perhaps 'name' names a context
            final Context context = lookupSubContext( name );
            return context.listBindings( "" );
        }
    }

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

Examples of javax.naming.Context.listBindings()

        final ResolveResult resolveResult = getBaseURLContext( name, getRawEnvironment() );
        final Context context = (Context)resolveResult.getResolvedObj();

        try
        {
            return context.listBindings( resolveResult.getRemainingName() );
        }
        finally
        {
            context.close();
        }
View Full Code Here

Examples of javax.naming.Context.listBindings()

        loader.addConfigurationListener((HermesConfigurationListener) listeners.next());
      }
    }

    if (oldContext != null) {
      for (NamingEnumeration iter = oldContext.listBindings(""); iter.hasMoreElements();) {
        Binding binding = (Binding) iter.next();

        try {
          if (oldContext.lookup(binding.getName()) instanceof Hermes) {
            Hermes hermes = (Hermes) oldContext.lookup(binding.getName());
View Full Code Here

Examples of javax.naming.Context.listBindings()

    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

Examples of javax.naming.Context.listBindings()

        if (object instanceof Context)
        {
            Context ctx = (Context) object;

            return ctx.listBindings("");
        }
        else
        {
            throw new NamingException("binding " + binding + " is not a Context");
        }
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.