org.jnp.interfaces
Class NamingContext

java.lang.Object
  extended byorg.jnp.interfaces.NamingContext
All Implemented Interfaces:
javax.naming.Context, java.io.Serializable

public class NamingContext
extends java.lang.Object
implements javax.naming.Context, java.io.Serializable

This class provides the jnp provider Context implementation. It is a Context interface wrapper for a RMI Naming instance that is obtained from either the local server instance or by locating the server given by the Context.PROVIDER_URL value. This class also serves as the jnp url resolution context. jnp style urls passed to the

See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_DISCOVERY_GROUP_ADDRESS
          The default discovery multicast information
static int DEFAULT_DISCOVERY_GROUP_PORT
           
static int DEFAULT_DISCOVERY_TIMEOUT
           
static java.util.Hashtable haServers
           
static java.lang.String JNP_DISABLE_DISCOVERY
          A flag to disable the broadcast discovery queries
static java.lang.String JNP_DISCOVERY_GROUP
          The multicast IP/address to which the discovery query is sent
static java.lang.String JNP_DISCOVERY_PORT
          The port to which the discovery query is sent
static java.lang.String JNP_DISCOVERY_TIMEOUT
          The time in MS to wait for a discovery query response
static java.lang.String JNP_DISCOVERY_TTL
          The time-to-live for the multicast discovery packets
static java.lang.String JNP_LOCAL_ADDRESS
          The local address to bind the connected bootstrap socket to
static java.lang.String JNP_LOCAL_PORT
          The local port to bind the connected bootstrap socket to
static java.lang.String JNP_MAX_RETRIES
          An integer that controls the number of connection retry attempts will be made on the initial connection to the naming server.
static java.lang.String JNP_PARSED_NAME
          An internal property added by parseNameForScheme if the input name uses a url prefix that was removed during cannonicalization.
static java.lang.String JNP_PARTITION_NAME
          The cluster partition discovery should be restricted to
static java.lang.String JNP_SOCKET_FACTORY
          The javax.net.SocketFactory impl to use for the bootstrap socket
static java.lang.String JNP_USE_RELATIVE_NAME
          A flag indicating the style of names passed to NamingManager method.
static Naming (src) localServer
           
static int MAX_RETRIES
          An obsolete constant replaced by the JNP_MAX_RETRIES value
 
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
NamingContext(java.util.Hashtable e, javax.naming.Name baseName, Naming (src)  server)
           
 
Method Summary
 java.lang.Object addToEnvironment(java.lang.String propName, java.lang.Object propVal)
           
 void bind(javax.naming.Name name, java.lang.Object obj)
           
 void bind(java.lang.String name, java.lang.Object obj)
           
 void close()
           
 javax.naming.Name composeName(javax.naming.Name name, javax.naming.Name prefix)
           
 java.lang.String composeName(java.lang.String name, java.lang.String prefix)
           
 javax.naming.Context createSubcontext(javax.naming.Name name)
           
 javax.naming.Context createSubcontext(java.lang.String name)
           
 void destroySubcontext(javax.naming.Name name)
           
 void destroySubcontext(java.lang.String name)
           
 java.util.Hashtable getEnvironment()
           
static Naming (src) getHANamingServerForPartition(java.lang.String partitionName)
           
 java.lang.String getNameInNamespace()
           
 javax.naming.NameParser getNameParser(javax.naming.Name name)
           
 javax.naming.NameParser getNameParser(java.lang.String name)
           
 Naming (src) getNaming()
           
 javax.naming.NamingEnumeration list(javax.naming.Name name)
           
 javax.naming.NamingEnumeration list(java.lang.String name)
           
 javax.naming.NamingEnumeration listBindings(javax.naming.Name name)
           
 javax.naming.NamingEnumeration listBindings(java.lang.String name)
           
 java.lang.Object lookup(javax.naming.Name name)
           
 java.lang.Object lookup(java.lang.String name)
           
 java.lang.Object lookupLink(javax.naming.Name name)
          Lookup the object referred to by name but don't dereferrence the final component.
 java.lang.Object lookupLink(java.lang.String name)
           
 void rebind(javax.naming.Name name, java.lang.Object obj)
           
 void rebind(java.lang.String name, java.lang.Object obj)
           
 java.lang.Object removeFromEnvironment(java.lang.String propName)
           
static void removeHANamingServerForPartition(java.lang.String partitionName)
           
 void rename(javax.naming.Name oldName, javax.naming.Name newName)
           
 void rename(java.lang.String oldname, java.lang.String newname)
           
protected  java.lang.Object resolveLink(java.lang.Object res, java.util.Hashtable refEnv)
           
static void setHANamingServerForPartition(java.lang.String partitionName, Naming (src)  haServer)
           
static void setLocal(Naming (src)  server)
           
 void setNaming(Naming (src)  server)
           
 void unbind(javax.naming.Name name)
           
 void unbind(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JNP_SOCKET_FACTORY

public static final java.lang.String JNP_SOCKET_FACTORY
The javax.net.SocketFactory impl to use for the bootstrap socket

See Also:
Constant Field Values (src)

JNP_LOCAL_ADDRESS

public static final java.lang.String JNP_LOCAL_ADDRESS
The local address to bind the connected bootstrap socket to

See Also:
Constant Field Values (src)

JNP_LOCAL_PORT

public static final java.lang.String JNP_LOCAL_PORT
The local port to bind the connected bootstrap socket to

See Also:
Constant Field Values (src)

JNP_DISABLE_DISCOVERY

public static final java.lang.String JNP_DISABLE_DISCOVERY
A flag to disable the broadcast discovery queries

See Also:
Constant Field Values (src)

JNP_PARTITION_NAME

public static final java.lang.String JNP_PARTITION_NAME
The cluster partition discovery should be restricted to

See Also:
Constant Field Values (src)

JNP_DISCOVERY_GROUP

public static final java.lang.String JNP_DISCOVERY_GROUP
The multicast IP/address to which the discovery query is sent

See Also:
Constant Field Values (src)

JNP_DISCOVERY_PORT

public static final java.lang.String JNP_DISCOVERY_PORT
The port to which the discovery query is sent

See Also:
Constant Field Values (src)

JNP_DISCOVERY_TTL

public static final java.lang.String JNP_DISCOVERY_TTL
The time-to-live for the multicast discovery packets

See Also:
Constant Field Values (src)

JNP_DISCOVERY_TIMEOUT

public static final java.lang.String JNP_DISCOVERY_TIMEOUT
The time in MS to wait for a discovery query response

See Also:
Constant Field Values (src)

JNP_PARSED_NAME

public static final java.lang.String JNP_PARSED_NAME
An internal property added by parseNameForScheme if the input name uses a url prefix that was removed during cannonicalization. This is needed to avoid modification of the incoming Name.

See Also:
Constant Field Values (src)

JNP_USE_RELATIVE_NAME

public static final java.lang.String JNP_USE_RELATIVE_NAME
A flag indicating the style of names passed to NamingManager method. True for api expected relative names, false for absolute names as used historically by the jboss naming implementation.

See Also:
Constant Field Values (src)

JNP_MAX_RETRIES

public static final java.lang.String JNP_MAX_RETRIES
An integer that controls the number of connection retry attempts will be made on the initial connection to the naming server. This only applies to ConnectException failures. A value <= 1 means that only one attempt will be made.

See Also:
Constant Field Values (src)

DEFAULT_DISCOVERY_GROUP_ADDRESS

public static final java.lang.String DEFAULT_DISCOVERY_GROUP_ADDRESS
The default discovery multicast information

See Also:
Constant Field Values (src)

DEFAULT_DISCOVERY_GROUP_PORT

public static final int DEFAULT_DISCOVERY_GROUP_PORT
See Also:
Constant Field Values (src)

DEFAULT_DISCOVERY_TIMEOUT

public static final int DEFAULT_DISCOVERY_TIMEOUT
See Also:
Constant Field Values (src)

MAX_RETRIES

public static int MAX_RETRIES
An obsolete constant replaced by the JNP_MAX_RETRIES value


haServers

public static java.util.Hashtable haServers

localServer

public static Naming (src)  localServer
Constructor Detail

NamingContext

public NamingContext(java.util.Hashtable e,
                     javax.naming.Name baseName,
                     Naming (src)  server)
              throws javax.naming.NamingException
Method Detail

setHANamingServerForPartition

public static void setHANamingServerForPartition(java.lang.String partitionName,
                                                 Naming (src)  haServer)

removeHANamingServerForPartition

public static void removeHANamingServerForPartition(java.lang.String partitionName)

getHANamingServerForPartition

public static Naming (src)  getHANamingServerForPartition(java.lang.String partitionName)

setLocal

public static void setLocal(Naming (src)  server)

getNaming

public Naming (src)  getNaming()

setNaming

public void setNaming(Naming (src)  server)

rebind

public void rebind(java.lang.String name,
                   java.lang.Object obj)
            throws javax.naming.NamingException
Specified by:
rebind in interface javax.naming.Context
Throws:
javax.naming.NamingException

rebind

public void rebind(javax.naming.Name name,
                   java.lang.Object obj)
            throws javax.naming.NamingException
Specified by:
rebind in interface javax.naming.Context
Throws:
javax.naming.NamingException

bind

public void bind(java.lang.String name,
                 java.lang.Object obj)
          throws javax.naming.NamingException
Specified by:
bind in interface javax.naming.Context
Throws:
javax.naming.NamingException

bind

public void bind(javax.naming.Name name,
                 java.lang.Object obj)
          throws javax.naming.NamingException
Specified by:
bind in interface javax.naming.Context
Throws:
javax.naming.NamingException

lookup

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

lookup

public java.lang.Object lookup(javax.naming.Name name)
                        throws javax.naming.NamingException
Specified by:
lookup in interface javax.naming.Context
Throws:
javax.naming.NamingException

unbind

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

unbind

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

rename

public void rename(java.lang.String oldname,
                   java.lang.String newname)
            throws javax.naming.NamingException
Specified by:
rename in interface javax.naming.Context
Throws:
javax.naming.NamingException

rename

public void rename(javax.naming.Name oldName,
                   javax.naming.Name newName)
            throws javax.naming.NamingException
Specified by:
rename in interface javax.naming.Context
Throws:
javax.naming.NamingException

list

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

list

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

listBindings

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

listBindings

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

composeName

public java.lang.String composeName(java.lang.String name,
                                    java.lang.String prefix)
                             throws javax.naming.NamingException
Specified by:
composeName in interface javax.naming.Context
Throws:
javax.naming.NamingException

composeName

public javax.naming.Name composeName(javax.naming.Name name,
                                     javax.naming.Name prefix)
                              throws javax.naming.NamingException
Specified by:
composeName in interface javax.naming.Context
Throws:
javax.naming.NamingException

getNameParser

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

getNameParser

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

createSubcontext

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

createSubcontext

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

addToEnvironment

public java.lang.Object addToEnvironment(java.lang.String propName,
                                         java.lang.Object propVal)
                                  throws javax.naming.NamingException
Specified by:
addToEnvironment in interface javax.naming.Context
Throws:
javax.naming.NamingException

removeFromEnvironment

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

getEnvironment

public java.util.Hashtable getEnvironment()
                                   throws javax.naming.NamingException
Specified by:
getEnvironment in interface javax.naming.Context
Throws:
javax.naming.NamingException

close

public void close()
           throws javax.naming.NamingException
Specified by:
close 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

destroySubcontext

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

destroySubcontext

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

lookupLink

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

lookupLink

public java.lang.Object lookupLink(javax.naming.Name name)
                            throws javax.naming.NamingException
Lookup the object referred to by name but don't dereferrence the final component. This really just involves returning the raw value returned by the Naming.lookup() method.

Specified by:
lookupLink in interface javax.naming.Context
Returns:
the raw object bound under name.
Throws:
javax.naming.NamingException

resolveLink

protected java.lang.Object resolveLink(java.lang.Object res,
                                       java.util.Hashtable refEnv)
                                throws javax.naming.NamingException
Throws:
javax.naming.NamingException