org.apache.avalon.excalibur.naming
Class AbstractURLContext
java.lang.Object
|
+--org.apache.avalon.excalibur.naming.AbstractContext
|
+--org.apache.avalon.excalibur.naming.AbstractURLContext
- All Implemented Interfaces:
- Context, NameParser
- public abstract class AbstractURLContext
- extends AbstractContext
- implements NameParser
Abstract JNDI Context that can be inherited from to
provide a particular type of Context.
- Version:
- $Revision: 1.5 $
- Author:
- Peter Donald
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 |
Methods inherited from class org.apache.avalon.excalibur.naming.AbstractContext |
addToEnvironment, bind, bind, close, composeName, composeName, createSubcontext, destroySubcontext, getEnvironment, getLeafName, getNameParser, getNameParser, getPathName, getRawEnvironment, isSelf, list, listBindings, lookup, lookupLink, lookupLink, rebind, rebind, removeFromEnvironment, rename, rename, unbind |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_scheme
protected final String m_scheme
AbstractURLContext
public AbstractURLContext(String scheme,
Hashtable environment)
parse
public Name parse(String name)
throws NamingException
- Specified by:
parse
in interface NameParser
getNameParser
protected NameParser getNameParser()
throws NamingException
- Overrides:
getNameParser
in class AbstractContext
bind
protected void bind(Name name,
Object object,
boolean rebind)
throws NamingException
- Helper method to bind
- Overrides:
bind
in class AbstractContext
createSubcontext
public Context createSubcontext(Name name)
throws NamingException
- Create a Subcontext.
- Parameters:
name
- the name of subcontext- Returns:
- the created context
- Throws:
NamingException
- if an error occurs (ie context exists, badly formated name etc)
destroySubcontext
public void destroySubcontext(Name name)
throws NamingException
getNameInNamespace
public String getNameInNamespace()
throws NamingException
list
public NamingEnumeration list(Name name)
throws NamingException
- Enumerates the names bound in the named context.
- Parameters:
name
- the name of the context- Returns:
- the enumeration
- Throws:
NamingException
- if an error occurs
listBindings
public NamingEnumeration listBindings(Name name)
throws NamingException
- Enumerates the names bound in the named context, along with the objects bound to them.
- Parameters:
name
- the name of the context- Returns:
- the enumeration
- Throws:
NamingException
- if an error occurs
lookup
public Object lookup(Name name)
throws NamingException
- Get the object named.
- Parameters:
name
- the name- Returns:
- the object
- Throws:
NamingException
- if an error occurs (ie object name is inavlid or unbound)
unbind
public void unbind(Name name)
throws NamingException
- Unbind a object from a name.
- Parameters:
name
- the name- Throws:
NamingException
- if an error occurs
getBaseURLContext
protected ResolveResult getBaseURLContext(Name name,
Hashtable environment)
throws NamingException
getEndIndexOfURLPart
protected int getEndIndexOfURLPart(String name,
int index)
throws NamingException
- Find end index of url part in string.
Default implementation looks for
//.../[name-part]
///[name-part]
//... (no name part)
[name-part]
- Parameters:
name
- the nameindex
- the index where "scheme:" ends- Returns:
- the index where url ends
- Throws:
NamingException
- if an error occurs
newContext
protected abstract Context newContext(String urlPart)
throws NamingException
- Return a new instance of the base context for a URL.
This must be implemented in particular URLContext.
- Parameters:
urlPart
- the part of url string not including "scheme:"- Returns:
- a base URLContext for urlPart
- Throws:
NamingException
- if an error occurs
"Copyright © 2000-2002 Apache Jakarta Project. All Rights Reserved."