|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.jndi.toolkit.url.GenericURLContext
public abstract class GenericURLContext
This abstract class is a generic URL context that accepts as the name argument either a string URL or a Name whose first component is a URL. It resolves the URL to a target context and then continues the operation using the remaining name in the target context as if the first component names a junction. A subclass must define getRootURLContext() to process the URL into head/tail pieces. If it wants to control how URL strings are parsed and compared for the rename() operation, then it should override getNonRootURLSuffixes() and urlEquals().
| Field Summary | |
|---|---|
protected Hashtable |
myEnv
|
| Fields inherited from interface javax.naming.Context |
|---|
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES |
| Constructor Summary | |
|---|---|
GenericURLContext(Hashtable env)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Hashtable myEnv
| Constructor Detail |
|---|
public GenericURLContext(Hashtable env)
| Method Detail |
|---|
public void close()
throws NamingException
close in interface ContextNamingException
public String getNameInNamespace()
throws NamingException
getNameInNamespace in interface ContextNamingException
protected abstract ResolveResult getRootURLContext(String url,
Hashtable env)
throws NamingException
NamingException
protected Name getURLSuffix(String prefix,
String url)
throws NamingException
This method returns a Name instead of a String because to give the provider an opportunity to return a Name (for example, for weakly separated naming systems like COS naming).
The default implementation uses skips 'prefix', calls UrlUtil.decode() on it, and returns the result as a single component CompositeName. Subclass should override if this is not appropriate. This method is used only by rename(). If rename() is supported for a particular URL scheme, getRootURLContext(), getURLPrefix(), and getURLSuffix() must be in sync wrt how URLs are parsed and returned.
For many URL schemes, this method is very similar to URL.getFile(),
except getFile() will return a leading slash in the
2nd, 3rd, and 4th cases. For schemes like "ldap" and "iiop",
the leading slash must be skipped before the name is an acceptable
format for operation by the Context methods. For schemes that treat the
leading slash as significant (such as "file"),
the subclass must override getURLSuffix() to get the correct behavior.
Remember, the behavior must match getRootURLContext().
URL Suffix
foo://host:port
NamingException
protected String getURLPrefix(String url)
throws NamingException
URL Prefix foo://host:port foo://host:port foo://host:port/rest/of/name foo://host:port foo:///rest/of/name foo:// foo:/rest/of/name foo: foo:rest/of/name foo:
NamingException
protected boolean urlEquals(String url1,
String url2)
protected Context getContinuationContext(Name n)
throws NamingException
NamingException
public Object lookup(String name)
throws NamingException
lookup in interface ContextNamingException
public Object lookup(Name name)
throws NamingException
lookup in interface ContextNamingException
public void bind(String name,
Object obj)
throws NamingException
bind in interface ContextNamingException
public void bind(Name name,
Object obj)
throws NamingException
bind in interface ContextNamingException
public void rebind(String name,
Object obj)
throws NamingException
rebind in interface ContextNamingException
public void rebind(Name name,
Object obj)
throws NamingException
rebind in interface ContextNamingException
public void unbind(String name)
throws NamingException
unbind in interface ContextNamingException
public void unbind(Name name)
throws NamingException
unbind in interface ContextNamingException
public void rename(String oldName,
String newName)
throws NamingException
rename in interface ContextNamingException
public void rename(Name name,
Name newName)
throws NamingException
rename in interface ContextNamingExceptionpubliclist(String name) throws NamingException
list in interface ContextNamingExceptionpubliclist(Name name) throws NamingException
list in interface ContextNamingExceptionpubliclistBindings(String name) throws NamingException
listBindings in interface ContextNamingExceptionpubliclistBindings(Name name) throws NamingException
listBindings in interface ContextNamingException
public void destroySubcontext(String name)
throws NamingException
destroySubcontext in interface ContextNamingException
public void destroySubcontext(Name name)
throws NamingException
destroySubcontext in interface ContextNamingException
public Context createSubcontext(String name)
throws NamingException
createSubcontext in interface ContextNamingException
public Context createSubcontext(Name name)
throws NamingException
createSubcontext in interface ContextNamingException
public Object lookupLink(String name)
throws NamingException
lookupLink in interface ContextNamingException
public Object lookupLink(Name name)
throws NamingException
lookupLink in interface ContextNamingException
public NameParser getNameParser(String name)
throws NamingException
getNameParser in interface ContextNamingException
public NameParser getNameParser(Name name)
throws NamingException
getNameParser in interface ContextNamingException
public String composeName(String name,
String prefix)
throws NamingException
composeName in interface ContextNamingException
public Name composeName(Name name,
Name prefix)
throws NamingException
composeName in interface ContextNamingException
public Object removeFromEnvironment(String propName)
throws NamingException
removeFromEnvironment in interface ContextNamingException
public Object addToEnvironment(String propName,
Object propVal)
throws NamingException
addToEnvironment in interface ContextNamingException
public Hashtable getEnvironment()
throws NamingException
getEnvironment in interface ContextNamingException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||