Package javax.naming

Examples of javax.naming.Context.list()


    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


        }
        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());
        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

        m_evaluators.clear();
        NamingEnumeration list = null;
        try
        {
            Context initialContext = new InitialContext();
            list = initialContext.list( QUERY_EVALUATOR_CONTEXT );
            NameClassPair pair = null;
            ExpressionEvaluator evaluator = null;
            while ( list.hasMore() )
            {
                pair = (NameClassPair) list.next();
View Full Code Here

        HashMap sections = new HashMap();
        try{
            ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
            Context ctx = containerSystem.getJNDIContext();
            ctx = (Context) ctx.lookup("openejb/ejb");
            NamingEnumeration enumeration = ctx.list("");
            //System.out.println("\n\nENUM "+enumeration);

            if ( enumeration == null){
                return sections;
            }
View Full Code Here

    Context oCtx = null;
    for (int i1 = 0; (!bCtxOK) && i1 < MAX_RETRIES; i1++) {
      // check if context is valid
      try {
                oCtx = new InitialContext(properties);
        oCtx.list("__dummy2@#$%");
        bCtxOK = true;
      } catch (NamingException nex) {
        bCtxOK = true;
      }
    }
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

            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

        {
            throw new NotContextException( name.toString() );
        }

        final Context context = (Context)entry;
        if( context.list( "" ).hasMoreElements() )
        {
            throw new ContextNotEmptyException( name.toString() );
        }
    }
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.