Search in sources :

Example 1 with Resolver

use of javax.naming.spi.Resolver in project jdk8u_jdk by JetBrains.

the class PartialCompositeContext method resolveToClass.

public ResolveResult resolveToClass(Name name, Class<? extends Context> contextType) throws NamingException {
    PartialCompositeContext ctx = this;
    Hashtable<?, ?> env = p_getEnvironment();
    Continuation cont = new Continuation(name, env);
    ResolveResult answer;
    Name nm = name;
    try {
        answer = ctx.p_resolveToClass(nm, contextType, cont);
        while (cont.isContinue()) {
            nm = cont.getRemainingName();
            ctx = getPCContext(cont);
            answer = ctx.p_resolveToClass(nm, contextType, cont);
        }
    } catch (CannotProceedException e) {
        Context cctx = NamingManager.getContinuationContext(e);
        if (!(cctx instanceof Resolver)) {
            throw e;
        }
        answer = ((Resolver) cctx).resolveToClass(e.getRemainingName(), contextType);
    }
    return answer;
}
Also used : Resolver(javax.naming.spi.Resolver) ResolveResult(javax.naming.spi.ResolveResult)

Aggregations

ResolveResult (javax.naming.spi.ResolveResult)1 Resolver (javax.naming.spi.Resolver)1