use of javax.naming.spi.ResolveResult in project wildfly by wildfly.
the class InMemoryNamingStoreTestCase method testBindAndLookupResolveResult.
@Test
public void testBindAndLookupResolveResult() throws Exception {
final Name name = new CompositeName("test");
final Reference reference = new Reference(Context.class.getName());
nameStore.bind(name, reference, Context.class);
final Object result = nameStore.lookup(new CompositeName("test/value"));
assertTrue(result instanceof ResolveResult);
}
use of javax.naming.spi.ResolveResult 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;
}
use of javax.naming.spi.ResolveResult in project jdk8u_jdk by JetBrains.
the class GenericURLContext method lookup.
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();
}
}
use of javax.naming.spi.ResolveResult in project jdk8u_jdk by JetBrains.
the class GenericURLContext method lookupLink.
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();
}
}
use of javax.naming.spi.ResolveResult in project jdk8u_jdk by JetBrains.
the class GenericURLContext method rename.
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();
}
}
Aggregations