org.codehaus.spice.jndikit
Class RemoteContext

java.lang.Object
  extended by org.codehaus.spice.jndikit.AbstractContext
      extended by org.codehaus.spice.jndikit.RemoteContext
All Implemented Interfaces:
Serializable, Context

public class RemoteContext
extends AbstractContext
implements Serializable

Context that hooks up to a remote source.

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

Field Summary
static String NAMESPACE
           
static String NAMESPACE_NAME
           
static String NAMING_PROVIDER
           
 
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(Hashtable environment, Name baseName)
           
 
Method Summary
protected  void bind(Name name, Object object, boolean rebind)
          Helper method to bind
 void close()
          Release resources associated with context.
 Context createSubcontext(Name name)
          Create a Subcontext.
 void destroySubcontext(Name name)
           
protected  void fillInContext(Context object)
           
protected  Name getAbsoluteName(Name name)
           
 String getNameInNamespace()
           
protected  NameParser getNameParser()
           
protected  Namespace getNamespace()
           
protected  NamingProvider getProvider()
           
protected  NamingException handleException(Exception e)
           
 NamingEnumeration list(Name name)
          Enumerates the names bound in the named context.
 NamingEnumeration listBindings(Name name)
          Enumerates the names bound in the named context, along with the objects bound to them.
 Object lookup(Name name)
          Get the object named.
 void unbind(Name name)
          Unbind a object from a name.
 
Methods inherited from class org.codehaus.spice.jndikit.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 String NAMESPACE_NAME
See Also:
Constant Field Values

NAMESPACE

public static final String NAMESPACE
See Also:
Constant Field Values

NAMING_PROVIDER

public static final String NAMING_PROVIDER
See Also:
Constant Field Values
Constructor Detail

RemoteContext

public RemoteContext()

RemoteContext

public RemoteContext(Hashtable environment,
                     Name baseName)
              throws NamingException
Throws:
NamingException
Method Detail

bind

protected void bind(Name name,
                    Object object,
                    boolean rebind)
             throws NamingException
Helper method to bind

Specified by:
bind in class AbstractContext
Throws:
NamingException

close

public void close()
Release resources associated with context.

Specified by:
close in interface Context
Overrides:
close in class AbstractContext

createSubcontext

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

Specified by:
createSubcontext in interface Context
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
Specified by:
destroySubcontext in interface Context
Throws:
NamingException

getNameInNamespace

public String getNameInNamespace()
                          throws NamingException
Specified by:
getNameInNamespace in interface Context
Throws:
NamingException

list

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

Specified by:
list in interface 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.

Specified by:
listBindings in interface Context
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.

Specified by:
lookup in interface Context
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.

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

fillInContext

protected void fillInContext(Context object)
                      throws NamingException
Throws:
NamingException

getNamespace

protected Namespace getNamespace()
                          throws NamingException
Throws:
NamingException

getProvider

protected NamingProvider getProvider()
                              throws NamingException
Throws:
NamingException

getNameParser

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

getAbsoluteName

protected Name getAbsoluteName(Name name)
                        throws NamingException
Throws:
NamingException

handleException

protected NamingException handleException(Exception e)


Copyright © 1999-2008 Codehaus. All Rights Reserved.