本文整理汇总了Java中javax.naming.spi.ResolveResult类的典型用法代码示例。如果您正苦于以下问题:Java ResolveResult类的具体用法?Java ResolveResult怎么用?Java ResolveResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResolveResult类属于javax.naming.spi包,在下文中一共展示了ResolveResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createUsingURL
import javax.naming.spi.ResolveResult; //导入依赖的package包/类
/**
* 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));
}
示例2: getRootURLContext
import javax.naming.spi.ResolveResult; //导入依赖的package包/类
/**
* 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));
}
示例3: rename
import javax.naming.spi.ResolveResult; //导入依赖的package包/类
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: rename
import javax.naming.spi.ResolveResult; //导入依赖的package包/类
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();
}
}
示例5: lookup
import javax.naming.spi.ResolveResult; //导入依赖的package包/类
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();
}
}
示例6: getAttributes
import javax.naming.spi.ResolveResult; //导入依赖的package包/类
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();
}
}
示例7: destroySubcontext
import javax.naming.spi.ResolveResult; //导入依赖的package包/类
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();
}
}
示例8: modifyAttributes
import javax.naming.spi.ResolveResult; //导入依赖的package包/类
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();
}
}
示例9: bind
import javax.naming.spi.ResolveResult; //导入依赖的package包/类
public void bind(String name, Object obj, Attributes attrs)
throws NamingException {
ResolveResult res = getRootURLContext(name, myEnv);
DirContext ctx = (DirContext)res.getResolvedObj();
try {
ctx.bind(res.getRemainingName(), obj, attrs);
} finally {
ctx.close();
}
}
示例10: list
import javax.naming.spi.ResolveResult; //导入依赖的package包/类
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();
}
}
示例11: createSubcontext
import javax.naming.spi.ResolveResult; //导入依赖的package包/类
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();
}
}
示例12: getSchemaClassDefinition
import javax.naming.spi.ResolveResult; //导入依赖的package包/类
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();
}
}
示例13: search
import javax.naming.spi.ResolveResult; //导入依赖的package包/类
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();
}
}
示例14: bind
import javax.naming.spi.ResolveResult; //导入依赖的package包/类
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();
}
}
示例15: rebind
import javax.naming.spi.ResolveResult; //导入依赖的package包/类
public void rebind(String name, Object obj) throws NamingException {
ResolveResult res = getRootURLContext(name, myEnv);
Context ctx = (Context)res.getResolvedObj();
try {
ctx.rebind(res.getRemainingName(), obj);
} finally {
ctx.close();
}
}