Package javax.naming.spi

Examples of javax.naming.spi.ResolveResult


               cpe.setResolvedObj(ctx);
               cpe.setRemainingName(name.getSuffix(1));
               throw cpe;
            }
           
            result = new ResolveResult(ctx, name.getSuffix(1));
         } else
         {
            throw new NotContextException();
         }
      }
View Full Code Here


            return res;
         }
         else if (res instanceof ResolveResult)
         {
            // Dereference partial result
            ResolveResult rr = (ResolveResult) res;
            Object resolveRes = rr.getResolvedObj();
            Object context;
            Object instanceID;

            if (resolveRes instanceof LinkRef)
            {
               context = resolveLink(resolveRes, null);
               instanceID = ((LinkRef) resolveRes).getLinkName();
            }
            else
            {
               context = getObjectInstanceWrapFailure(resolveRes, name, refEnv);
               instanceID = context;
            }

            if ((context instanceof Context) == false)
            {
               throw new NotContextException(instanceID + " is not a Context");
            }
            Context ncontext = (Context) context;
            return ncontext.lookup(rr.getRemainingName());
         }
         else if (res instanceof LinkRef)
         {
            // Dereference link
            res = resolveLink(res, refEnv);
View Full Code Here

            final Context continuationContext = NamingManager.getContinuationContext(cpe);
            result = continuationContext.lookup(cpe.getRemainingName());
        }

        if (result instanceof ResolveResult) {
            final ResolveResult resolveResult = (ResolveResult) result;
            final Object resolvedObject = resolveResult.getResolvedObj();

            Object context;
            if (resolvedObject instanceof LinkRef) {
                context = resolveLink(resolvedObject);
            } else {
                context = getObjectInstance(resolvedObject, absoluteName, environment);
            }
            if (!(context instanceof Context)) {
                throw notAContextException(absoluteName.getPrefix(absoluteName.size() - resolveResult.getRemainingName().size()));
            }
            final Context namingContext = (Context) context;
            return namingContext.lookup(resolveResult.getRemainingName());
        } else if (result instanceof LinkRef) {
            result = resolveLink(result);
        } else if (result instanceof Reference) {
            result = getObjectInstance(result, absoluteName, environment);
            if (result instanceof LinkRef) {
View Full Code Here

        protected Object foundReferenceInsteadOfContext(final BindingNode bindingNode) throws NamingException {
            final Name remainingName = targetName.getSuffix(bindingNode.fullName.size());
            final Object boundObject = bindingNode.binding.getObject();
            checkReferenceForContinuation(remainingName, boundObject);
            return new ResolveResult(boundObject, remainingName);
        }
View Full Code Here

            return res;
         }
         else if (res instanceof ResolveResult)
         {
            // Dereference partial result
            ResolveResult rr = (ResolveResult) res;
            Object resolveRes = rr.getResolvedObj();
            Object context;
            Object instanceID;

            if (resolveRes instanceof LinkRef)
            {
               context = resolveLink(resolveRes, null);
               instanceID = ((LinkRef) resolveRes).getLinkName();
            }
            else
            {
               context = getObjectInstanceWrapFailure(resolveRes, name, refEnv);
               instanceID = context;
            }

            if ((context instanceof Context) == false)
            {
               throw new NotContextException(instanceID + " is not a Context");
            }
            Context ncontext = (Context) context;
            return ncontext.lookup(rr.getRemainingName());
         }
         else if (res instanceof LinkRef)
         {
            // Dereference link
            res = resolveLink(res, refEnv);
View Full Code Here

            return res;
         }
         else if (res instanceof ResolveResult)
         {
            // Dereference partial result
            ResolveResult rr = (ResolveResult) res;
            Object resolveRes = rr.getResolvedObj();
            Object context;
            Object instanceID;

            if (resolveRes instanceof LinkRef)
            {
               context = resolveLink(resolveRes, null);
               instanceID = ((LinkRef) resolveRes).getLinkName();
            }
            else
            {
               context = getObjectInstanceWrapFailure(resolveRes, name, refEnv);
               instanceID = context;
            }

            if ((context instanceof Context) == false)
            {
               throw new NotContextException(instanceID + " is not a Context");
            }
            Context ncontext = (Context) context;
            return ncontext.lookup(rr.getRemainingName());
         }
         else if (res instanceof LinkRef)
         {
            // Dereference link
            res = resolveLink(res, refEnv);
View Full Code Here

            return res;
         }
         else if (res instanceof ResolveResult)
         {
            // Dereference partial result
            ResolveResult rr = (ResolveResult) res;
            Object resolveRes = rr.getResolvedObj();
            Object context;
            Object instanceID;

            if (resolveRes instanceof LinkRef)
            {
               context = resolveLink(resolveRes, null);
               instanceID = ((LinkRef) resolveRes).getLinkName();
            }
            else
            {
               context = getObjectInstanceWrapFailure(resolveRes, name, refEnv);
               instanceID = context;
            }

            if ((context instanceof Context) == false)
            {
               throw new NotContextException(instanceID + " is not a Context");
            }
            Context ncontext = (Context) context;
            return ncontext.lookup(rr.getRemainingName());
         }
         else if (res instanceof LinkRef)
         {
            // Dereference link
            res = resolveLink(res, refEnv);
View Full Code Here

            final ServiceName lower = boundServices.lower(lookupName);
            if (lower != null && lower.isParentOf(lookupName)) {
                // Parent might be a reference or a link
                obj = lookup(name.toString(), lower);
                checkReferenceForContinuation(name, obj);
                return new ResolveResult(obj, suffix(lower, lookupName));
            }

            final ServiceName ceiling = boundServices.ceiling(lookupName);
            if (ceiling != null && lookupName.isParentOf(ceiling)) {
                return new NamingContext((Name) name.clone(), this, null);
View Full Code Here

        // rest is the INS name
        // Return the parsed form to prevent subsequent lookup
        // from parsing the string as a composite name
        // The caller should be aware that a toString() of the name
        // will yield its INS syntax, rather than a composite syntax
        return new ResolveResult(ctx, parser.parse(rest));
    }
View Full Code Here

    private NamingEnumeration searchUsingURL(String name)
        throws NamingException {

        LdapURL url = new LdapURL(name);

        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return ctx.search(res.getRemainingName(),
                              setFilterUsingURL(url),
                              setSearchControlsUsingURL(url));
        } finally {
            ctx.close();
        }
View Full Code Here

TOP

Related Classes of javax.naming.spi.ResolveResult

Copyright © 2018 www.massapicom. 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.