Package javax.naming

Examples of javax.naming.Context.list()


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

        try {
            return context.list(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.list(result.getRemainingName());
        } finally {
            context.close();
        }
    }
View Full Code Here

        if (remainingName != null) {
            CannotProceedException cpe = constructCannotProceedException(
                    altName, remainingName);
            Context nnsContext = DirectoryManager.getContinuationContext(cpe);

            result = (NamingEnumeration<T>) nnsContext.list(remainingName);
        } else {
            // do the job
            try {
                Enumeration<ResourceRecord> resEnum = resolver.list(nameToList
                        .toString());
View Full Code Here

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

            while (enumeration.hasMoreElements()) {
                final NameClassPair pair = enumeration.nextElement();
                bindings.add(new LazyBinding(pair.getName(), pair.getClassName(), context));
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

     *
     */
    private void printCompEnv() throws NamingException {
        log.warn("Printing java:comp/env/jms context: ");
        Context c = (Context) new InitialContext().lookup("java:comp/env/jms");
        NamingEnumeration iter = c.list("");
        while (iter.hasMoreElements()) {
            NameClassPair pair = (NameClassPair) iter.next();
            log.warn("'" + pair.getName() + "'");
            /*
             * Object obj = ctx.lookup(node.getName()); if ( obj instanceof
View Full Code Here

    *
    */
   private void printCompEnv() throws NamingException {
       log.warn("Printing java:comp/env/jms context: ");
       Context c = (Context) new InitialContext().lookup("java:comp/env/jms");
       NamingEnumeration iter = c.list("");
       while (iter.hasMoreElements()) {
           NameClassPair pair = (NameClassPair) iter.next();
           log.warn("'" + pair.getName() + "'");
           /*
            * Object obj = ctx.lookup(node.getName()); if ( obj instanceof
View Full Code Here

        }
        final Context namespaceContext = selector.getContext(parsedName.namespace());
        if (namespaceContext == null) {
            throw new NameNotFoundException(name.toString());
        }
        return namespaceContext.list(parsedName.remaining());
    }

    public void bind(Name name, Object object) throws NamingException {
        final ParsedName parsedName = parse(name);
        if (parsedName.namespace() == null || parsedName.namespace().equals("")) {
View Full Code Here

    public NamingEnumeration<NameClassPair> list(final Name name) throws NamingException {
        try {
            return namingEnumeration(namingStore.list(getAbsoluteName(name)));
        } catch(CannotProceedException cpe) {
            final Context continuationContext = NamingManager.getContinuationContext(cpe);
            return continuationContext.list(cpe.getRemainingName());
        }
    }

    /** {@inheritDoc} */
    public NamingEnumeration<NameClassPair> list(final String name) throws NamingException {
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.