org.apache.avalon.excalibur.naming
Class RemoteContext

java.lang.Object
  extended byorg.apache.avalon.excalibur.naming.AbstractContext
      extended byorg.apache.avalon.excalibur.naming.RemoteContext
All Implemented Interfaces:
javax.naming.Context, java.io.Serializable

public class RemoteContext
extends AbstractContext
implements java.io.Serializable

Context that hooks up to a remote source.

Version:
$Revision: 1.6 $
Author:
Peter Donald
See Also:
Serialized Form

Field Summary
private  javax.naming.Name m_baseName
           
private  javax.naming.NameParser m_nameParser
           
private  Namespace m_namespace
           
private  NamingProvider m_provider
           
static java.lang.String NAMESPACE
           
static java.lang.String NAMESPACE_NAME
           
static java.lang.String NAMING_PROVIDER
           
 
Fields inherited from class org.apache.avalon.excalibur.naming.AbstractContext
 
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
RemoteContext()
           
RemoteContext(java.util.Hashtable environment, javax.naming.Name baseName)
           
 
Method Summary
protected  void bind(javax.naming.Name name, java.lang.Object object, boolean rebind)
          Helper method to bind
 void close()
          Release resources associated with context.
 javax.naming.Context createSubcontext(javax.naming.Name name)
          Create a Subcontext.
 void destroySubcontext(javax.naming.Name name)
           
protected  void fillInContext(javax.naming.Context object)
           
protected  javax.naming.Name getAbsoluteName(javax.naming.Name name)
           
 java.lang.String getNameInNamespace()
           
protected  javax.naming.NameParser getNameParser()
           
protected  Namespace getNamespace()
           
protected  NamingProvider getProvider()
           
protected  javax.naming.NamingException handleException(java.lang.Exception e)
           
 javax.naming.NamingEnumeration list(javax.naming.Name name)
          Enumerates the names bound in the named context.
 javax.naming.NamingEnumeration listBindings(javax.naming.Name name)
          Enumerates the names bound in the named context, along with the objects bound to them.
 java.lang.Object lookup(javax.naming.Name name)
          Get the object named.
 void unbind(javax.naming.Name name)
          Unbind a object from a name.
 
Methods inherited from class org.apache.avalon.excalibur.naming.AbstractContext
addToEnvironment, bind, bind, 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
 

Field Detail

NAMESPACE_NAME

public static final java.lang.String NAMESPACE_NAME
See Also:
Constant Field Values

NAMESPACE

public static final java.lang.String NAMESPACE
See Also:
Constant Field Values

NAMING_PROVIDER

public static final java.lang.String NAMING_PROVIDER
See Also:
Constant Field Values

m_provider

private transient NamingProvider m_provider

m_nameParser

private transient javax.naming.NameParser m_nameParser

m_namespace

private transient Namespace m_namespace

m_baseName

private javax.naming.Name m_baseName
Constructor Detail

RemoteContext

public RemoteContext()

RemoteContext

public RemoteContext(java.util.Hashtable environment,
                     javax.naming.Name baseName)
              throws javax.naming.NamingException
Method Detail

bind

protected void bind(javax.naming.Name name,
                    java.lang.Object object,
                    boolean rebind)
             throws javax.naming.NamingException
Helper method to bind

Specified by:
bind in class AbstractContext
Throws:
javax.naming.NamingException

close

public void close()
Release resources associated with context.

Specified by:
close in interface javax.naming.Context
Overrides:
close in class AbstractContext

createSubcontext

public javax.naming.Context createSubcontext(javax.naming.Name name)
                                      throws javax.naming.NamingException
Create a Subcontext.

Specified by:
createSubcontext in interface javax.naming.Context
Parameters:
name - the name of subcontext
Returns:
the created context
Throws:
javax.naming.NamingException - if an error occurs (ie context exists, badly formated name etc)

destroySubcontext

public void destroySubcontext(javax.naming.Name name)
                       throws javax.naming.NamingException
Specified by:
destroySubcontext in interface javax.naming.Context
Throws:
javax.naming.NamingException

getNameInNamespace

public java.lang.String getNameInNamespace()
                                    throws javax.naming.NamingException
Specified by:
getNameInNamespace in interface javax.naming.Context
Throws:
javax.naming.NamingException

list

public javax.naming.NamingEnumeration list(javax.naming.Name name)
                                    throws javax.naming.NamingException
Enumerates the names bound in the named context.

Specified by:
list in interface javax.naming.Context
Parameters:
name - the name of the context
Returns:
the enumeration
Throws:
javax.naming.NamingException - if an error occurs

listBindings

public javax.naming.NamingEnumeration listBindings(javax.naming.Name name)
                                            throws javax.naming.NamingException
Enumerates the names bound in the named context, along with the objects bound to them.

Specified by:
listBindings in interface javax.naming.Context
Parameters:
name - the name of the context
Returns:
the enumeration
Throws:
javax.naming.NamingException - if an error occurs

lookup

public java.lang.Object lookup(javax.naming.Name name)
                        throws javax.naming.NamingException
Get the object named.

Specified by:
lookup in interface javax.naming.Context
Parameters:
name - the name
Returns:
the object
Throws:
javax.naming.NamingException - if an error occurs (ie object name is inavlid or unbound)

unbind

public void unbind(javax.naming.Name name)
            throws javax.naming.NamingException
Unbind a object from a name.

Specified by:
unbind in interface javax.naming.Context
Parameters:
name - the name
Throws:
javax.naming.NamingException - if an error occurs

fillInContext

protected void fillInContext(javax.naming.Context object)
                      throws javax.naming.NamingException
Throws:
javax.naming.NamingException

getNamespace

protected Namespace getNamespace()
                          throws javax.naming.NamingException
Throws:
javax.naming.NamingException

getProvider

protected NamingProvider getProvider()
                              throws javax.naming.NamingException
Throws:
javax.naming.NamingException

getNameParser

protected javax.naming.NameParser getNameParser()
                                         throws javax.naming.NamingException
Specified by:
getNameParser in class AbstractContext
Throws:
javax.naming.NamingException

getAbsoluteName

protected javax.naming.Name getAbsoluteName(javax.naming.Name name)
                                     throws javax.naming.NamingException
Throws:
javax.naming.NamingException

handleException

protected javax.naming.NamingException handleException(java.lang.Exception e)