类javax.naming.spi.ResolveResult源码实例Demo

下面列出了怎么用javax.naming.spi.ResolveResult的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: openjdk-jdk8u   文件: dnsURLContext.java
/**
 * Resolves the host and port of "url" to a root context connected
 * to the named DNS server, and returns the domain name as the
 * remaining name.
 */
protected ResolveResult getRootURLContext(String url, Hashtable<?,?> env)
        throws NamingException {

    DnsUrl dnsUrl;
    try {
        dnsUrl = new DnsUrl(url);
    } catch (MalformedURLException e) {
        throw new InvalidNameException(e.getMessage());
    }

    DnsUrl[] urls = new DnsUrl[] { dnsUrl };
    String domain = dnsUrl.getDomain();

    return new ResolveResult(
            DnsContextFactory.getContext(".", urls, env),
            new CompositeName().add(domain));
}
 
源代码2 项目: jdk8u60   文件: GenericURLContext.java
public void rename(String oldName, String newName) throws NamingException {
    String oldPrefix = getURLPrefix(oldName);
    String newPrefix = getURLPrefix(newName);
    if (!urlEquals(oldPrefix, newPrefix)) {
        throw new OperationNotSupportedException(
            "Renaming using different URL prefixes not supported : " +
            oldName + " " + newName);
    }

    ResolveResult res = getRootURLContext(oldName, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        ctx.rename(res.getRemainingName(), getURLSuffix(newPrefix, newName));
    } finally {
        ctx.close();
    }
}
 
源代码3 项目: dragonwell8_jdk   文件: GenericURLContext.java
public void rename(String oldName, String newName) throws NamingException {
    String oldPrefix = getURLPrefix(oldName);
    String newPrefix = getURLPrefix(newName);
    if (!urlEquals(oldPrefix, newPrefix)) {
        throw new OperationNotSupportedException(
            "Renaming using different URL prefixes not supported : " +
            oldName + " " + newName);
    }

    ResolveResult res = getRootURLContext(oldName, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        ctx.rename(res.getRemainingName(), getURLSuffix(newPrefix, newName));
    } finally {
        ctx.close();
    }
}
 
源代码4 项目: TencentKona-8   文件: CNCtx.java
/**
 * This method is used by the iiop and iiopname URL Context factories.
 */
@SuppressWarnings("unchecked")
public static ResolveResult createUsingURL(String url, Hashtable<?,?> env)
throws NamingException {
    CNCtx ctx = new CNCtx();
    if (env != null) {
        env = (Hashtable<?,?>) env.clone();
    }
    ctx._env = (Hashtable<String, java.lang.Object>)env;
    String rest = ctx.initUsingUrl(
        env != null ?
            (org.omg.CORBA.ORB) env.get("java.naming.corba.orb")
            : null,
        url, env);

    // 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,
    // which came from the environment will yield its INS syntax,
    // rather than a composite syntax
    return new ResolveResult(ctx, parser.parse(rest));
}
 
源代码5 项目: openjdk-jdk8u   文件: GenericURLContext.java
public void rename(String oldName, String newName) throws NamingException {
    String oldPrefix = getURLPrefix(oldName);
    String newPrefix = getURLPrefix(newName);
    if (!urlEquals(oldPrefix, newPrefix)) {
        throw new OperationNotSupportedException(
            "Renaming using different URL prefixes not supported : " +
            oldName + " " + newName);
    }

    ResolveResult res = getRootURLContext(oldName, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        ctx.rename(res.getRemainingName(), getURLSuffix(newPrefix, newName));
    } finally {
        ctx.close();
    }
}
 
源代码6 项目: jdk8u60   文件: CNCtx.java
/**
 * This method is used by the iiop and iiopname URL Context factories.
 */
@SuppressWarnings("unchecked")
public static ResolveResult createUsingURL(String url, Hashtable<?,?> env)
throws NamingException {
    CNCtx ctx = new CNCtx();
    if (env != null) {
        env = (Hashtable<?,?>) env.clone();
    }
    ctx._env = (Hashtable<String, java.lang.Object>)env;
    String rest = ctx.initUsingUrl(
        env != null ?
            (org.omg.CORBA.ORB) env.get("java.naming.corba.orb")
            : null,
        url, env);

    // 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,
    // which came from the environment will yield its INS syntax,
    // rather than a composite syntax
    return new ResolveResult(ctx, parser.parse(rest));
}
 
源代码7 项目: openjdk-jdk8u   文件: GenericURLDirContext.java
public NamingEnumeration<SearchResult> search(String name,
    String filterExpr,
    Object[] filterArgs,
    SearchControls cons)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return
                ctx.search(res.getRemainingName(), filterExpr, filterArgs, cons);
        } finally {
            ctx.close();
        }
}
 
源代码8 项目: openjdk-jdk8u   文件: ldapURLContext.java
private NamingEnumeration<SearchResult> 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();
    }
}
 
源代码9 项目: dragonwell8_jdk   文件: ldapURLContext.java
private NamingEnumeration<SearchResult> 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();
    }
}
 
源代码10 项目: dragonwell8_jdk   文件: GenericURLDirContext.java
public Attributes getAttributes(String name) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    DirContext ctx = (DirContext)res.getResolvedObj();
    try {
        return ctx.getAttributes(res.getRemainingName());
    } finally {
        ctx.close();
    }
}
 
源代码11 项目: dragonwell8_jdk   文件: GenericURLDirContext.java
public Attributes getAttributes(String name, String[] attrIds)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return ctx.getAttributes(res.getRemainingName(), attrIds);
        } finally {
            ctx.close();
        }
}
 
源代码12 项目: dragonwell8_jdk   文件: GenericURLDirContext.java
public void modifyAttributes(String name, int mod_op, Attributes attrs)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            ctx.modifyAttributes(res.getRemainingName(), mod_op, attrs);
        } finally {
            ctx.close();
        }
}
 
源代码13 项目: dragonwell8_jdk   文件: GenericURLDirContext.java
public void modifyAttributes(String name, ModificationItem[] mods)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            ctx.modifyAttributes(res.getRemainingName(), mods);
        } finally {
            ctx.close();
        }
}
 
源代码14 项目: openjdk-jdk8u   文件: GenericURLDirContext.java
public DirContext createSubcontext(String name, Attributes attrs)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return ctx.createSubcontext(res.getRemainingName(), attrs);
        } finally {
            ctx.close();
        }
}
 
源代码15 项目: openjdk-jdk8u   文件: GenericURLDirContext.java
public Attributes getAttributes(String name, String[] attrIds)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return ctx.getAttributes(res.getRemainingName(), attrIds);
        } finally {
            ctx.close();
        }
}
 
源代码16 项目: dragonwell8_jdk   文件: GenericURLDirContext.java
public DirContext createSubcontext(String name, Attributes attrs)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return ctx.createSubcontext(res.getRemainingName(), attrs);
        } finally {
            ctx.close();
        }
}
 
源代码17 项目: dragonwell8_jdk   文件: GenericURLDirContext.java
public DirContext getSchemaClassDefinition(String name)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return ctx.getSchemaClassDefinition(res.getRemainingName());
        } finally {
            ctx.close();
        }
}
 
源代码18 项目: openjdk-jdk8u   文件: GenericURLDirContext.java
public NamingEnumeration<SearchResult> search(String name,
    Attributes matchingAttributes)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return ctx.search(res.getRemainingName(), matchingAttributes);
        } finally {
            ctx.close();
        }
}
 
源代码19 项目: dragonwell8_jdk   文件: GenericURLDirContext.java
public NamingEnumeration<SearchResult> search(String name,
    Attributes matchingAttributes,
    String[] attributesToReturn)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return ctx.search(res.getRemainingName(),
                matchingAttributes, attributesToReturn);
        } finally {
            ctx.close();
        }
}
 
源代码20 项目: jdk8u60   文件: GenericURLDirContext.java
public NamingEnumeration<SearchResult> search(String name,
    String filter,
    SearchControls cons)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return ctx.search(res.getRemainingName(), filter, cons);
        } finally {
            ctx.close();
        }
}
 
源代码21 项目: dragonwell8_jdk   文件: GenericURLDirContext.java
public NamingEnumeration<SearchResult> search(String name,
    String filterExpr,
    Object[] filterArgs,
    SearchControls cons)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return
                ctx.search(res.getRemainingName(), filterExpr, filterArgs, cons);
        } finally {
            ctx.close();
        }
}
 
源代码22 项目: dragonwell8_jdk   文件: GenericURLContext.java
public Object lookup(String name) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        return ctx.lookup(res.getRemainingName());
    } finally {
        ctx.close();
    }
}
 
源代码23 项目: dragonwell8_jdk   文件: GenericURLContext.java
public void bind(String name, Object obj) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        ctx.bind(res.getRemainingName(), obj);
    } finally {
        ctx.close();
    }
}
 
源代码24 项目: openjdk-jdk8u   文件: GenericURLDirContext.java
public DirContext getSchemaClassDefinition(String name)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return ctx.getSchemaClassDefinition(res.getRemainingName());
        } finally {
            ctx.close();
        }
}
 
源代码25 项目: dragonwell8_jdk   文件: GenericURLContext.java
public NamingEnumeration<NameClassPair> list(String name)   throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        return ctx.list(res.getRemainingName());
    } finally {
        ctx.close();
    }
}
 
源代码26 项目: dragonwell8_jdk   文件: GenericURLContext.java
public NamingEnumeration<Binding> listBindings(String name)
    throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        return ctx.listBindings(res.getRemainingName());
    } finally {
        ctx.close();
    }
}
 
源代码27 项目: dragonwell8_jdk   文件: GenericURLContext.java
public void destroySubcontext(String name) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        ctx.destroySubcontext(res.getRemainingName());
    } finally {
        ctx.close();
    }
}
 
源代码28 项目: jdk8u60   文件: GenericURLDirContext.java
public NamingEnumeration<SearchResult> search(String name,
    Attributes matchingAttributes,
    String[] attributesToReturn)
    throws NamingException {
        ResolveResult res = getRootURLContext(name, myEnv);
        DirContext ctx = (DirContext)res.getResolvedObj();
        try {
            return ctx.search(res.getRemainingName(),
                matchingAttributes, attributesToReturn);
        } finally {
            ctx.close();
        }
}
 
源代码29 项目: dragonwell8_jdk   文件: GenericURLContext.java
public Object lookupLink(String name) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        return ctx.lookupLink(res.getRemainingName());
    } finally {
        ctx.close();
    }
}
 
源代码30 项目: jdk8u60   文件: GenericURLContext.java
public NamingEnumeration<NameClassPair> list(String name)   throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    Context ctx = (Context)res.getResolvedObj();
    try {
        return ctx.list(res.getRemainingName());
    } finally {
        ctx.close();
    }
}
 
 类所在包
 类方法
 同包方法