|
IBM WebSphere Application ServerTM Release 8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.websphere.naming.JndiHelper
public class JndiHelper
Static JNDI helper methods which can be divided into two categories:
Nested Class Summary | |
---|---|
protected static class |
JndiHelper.Operation
|
Constructor Summary | |
---|---|
protected |
JndiHelper()
Protected empty constructor which prevents anyone from creating an instance of this class. |
Method Summary | |
---|---|
protected static void |
batchCreateSubcontextsDriver(WsnBatchModeContext startingContext,
javax.naming.Name name)
|
protected static javax.naming.Context |
createSubcontextsDriver(javax.naming.Context startingContext,
javax.naming.Name name)
|
protected static javax.naming.Context |
getSubcontextFromBatchResults(javax.naming.Context startingContext,
java.util.Enumeration vEnum,
int numCtx)
|
static java.lang.String |
normalizeHostname(java.util.Hashtable env)
Returns a normalized form of the local hostname for consistent use in the NameSpace. |
static java.lang.String |
normalizeHostname(java.util.Hashtable env,
java.net.InetAddress ipAddress)
Returns a normalized form of the hostname represented by the ipAddress parameter for consistent use in the NameSpace. |
static java.lang.String |
normalizeHostname(java.util.Hashtable env,
java.lang.String hostname)
Returns a normalized form of the hostname parameter for consistent use in the NameSpace. |
static void |
recursiveBind(javax.naming.Context startingContext,
javax.naming.Name name,
java.lang.Object obj)
Binds the object with the specified name to the name space such that all intermediate subcontexts in the name are created if they do not already exist. |
static void |
recursiveBind(javax.naming.Context startingContext,
java.lang.String name,
java.lang.Object obj)
String form of the recursiveBind(Context, Name, Object) method. |
static javax.naming.Context |
recursiveCreateSubcontext(javax.naming.Context startingContext,
javax.naming.Name name)
Creates a subcontext with the specified name such that all intermediate subcontexts in the name are created if they do not already exist. |
static javax.naming.Context |
recursiveCreateSubcontext(javax.naming.Context startingContext,
java.lang.String name)
String form of the recursiveCreateSubcontext(Context, Name) method. |
static void |
recursiveRebind(javax.naming.Context startingContext,
javax.naming.Name name,
java.lang.Object obj)
Rebinds the object with the specified name to the name space such that all intermediate subcontexts in the name are created if they do not already exist. |
static void |
recursiveRebind(javax.naming.Context startingContext,
java.lang.String name,
java.lang.Object obj)
String form of the recursiveRebind(Context, Name, Object) method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected JndiHelper()
Method Detail |
---|
public static javax.naming.Context recursiveCreateSubcontext(javax.naming.Context startingContext, java.lang.String name) throws javax.naming.NamingException
recursiveCreateSubcontext(Context, Name)
method.
startingContext
- The context to which the specified name is relative.name
- String form of the name of the context to create.
javax.naming.NotContextException
- Some object other than a context is bound to the
name space with a name that conflicts with the specified name.
javax.naming.NamingException
- A naming exception was encountered.recursiveCreateSubcontext(Context, Name)
public static javax.naming.Context recursiveCreateSubcontext(javax.naming.Context startingContext, javax.naming.Name name) throws javax.naming.NamingException
startingContext
- The context to which the specified name is relative.name
- The name of the context to create.
javax.naming.NotContextException
- Some object other than a context is bound to the
name space with a name that conflicts with the specified name.
javax.naming.NamingException
- A naming exception was encountered.recursiveCreateSubcontext(Context, String)
protected static void batchCreateSubcontextsDriver(WsnBatchModeContext startingContext, javax.naming.Name name) throws javax.naming.NamingException
javax.naming.NamingException
protected static javax.naming.Context createSubcontextsDriver(javax.naming.Context startingContext, javax.naming.Name name) throws javax.naming.NamingException
javax.naming.NamingException
public static void recursiveRebind(javax.naming.Context startingContext, java.lang.String name, java.lang.Object obj) throws javax.naming.NamingException
recursiveRebind(Context, Name, Object)
method.
startingContext
- The context to which the specified name is relative.name
- String form of the name of the object to rebind.obj
- The object to rebind.
javax.naming.NotContextException
- Some object other than a context is bound to the
name space with a name that conflicts with the specified name.
javax.naming.NamingException
- A naming exception was encountered.recursiveRebind(Context, Name, Object)
public static void recursiveRebind(javax.naming.Context startingContext, javax.naming.Name name, java.lang.Object obj) throws javax.naming.NamingException
startingContext
- The context to which the specified name is relative.name
- Name of the object to rebind.obj
- The object to rebind.
javax.naming.NotContextException
- Some object other than a context is bound to the
name space with a name that conflicts with the specified name.
javax.naming.NamingException
- A naming exception was encountered.recursiveRebind(Context, String, Object)
public static void recursiveBind(javax.naming.Context startingContext, java.lang.String name, java.lang.Object obj) throws javax.naming.NamingException
recursiveBind(Context, Name, Object)
method.
startingContext
- The context to which the specified name is relative.name
- String form of the name of the object to bind.obj
- The object to bind.
javax.naming.NotContextException
- Some object other than a context is bound to the
name space with a name that conflicts with the specified name.
javax.naming.NameAlreadyBoundException
- thrown if and only if the leaf name
corresponds to an already bound object. Not thrown if an intermediate
context is already bound.
javax.naming.NamingException
- A naming exception was encountered.recursiveBind(Context, Name, Object)
public static void recursiveBind(javax.naming.Context startingContext, javax.naming.Name name, java.lang.Object obj) throws javax.naming.NamingException
startingContext
- The context to which the specified name is relative.name
- Name
of the object to bind.obj
- The object to bind.
javax.naming.NotContextException
- Some object other than a context is bound to the
name space with a name that conflicts with the specified name.
javax.naming.NameAlreadyBoundException
- thrown if and only if the leaf name
corresponds to an already bound object. Not thrown if an intermediate
context is already bound.
javax.naming.NamingException
- A naming exception was encountered.recursiveBind(Context, String, Object)
protected static javax.naming.Context getSubcontextFromBatchResults(javax.naming.Context startingContext, java.util.Enumeration vEnum, int numCtx) throws javax.naming.NamingException
startingContext
- vEnum
- numCtx
-
javax.naming.NamingException
public static java.lang.String normalizeHostname(java.util.Hashtable env) throws javax.naming.NamingException
HostnameNormalizer
interface.
HostnameNormalizer.ESCAPE_DOTS_TRUE
.
Websphere supplies a DefaultHostnameNormalizer which operates as follows:
HostnameNormalizer.ESCAPE_DOTS_TRUE
is passed, prepends
all dots (".") with the escape character ("\"). This is necessary
for INS syntax names.
HostnameNormalizer.ESCAPE_DOTS_FALSE
is passed, no special
processing is done for dots
If your environment requires a different normalization algorithm, you can supply your
own implementation of the HostnameNormalizer interface. You will need to set
com.ibm.websphere.naming.hostname.normalizer to the name of your implementing
class. It is recommended that you do this in a jndi.properties file which is
in your classpath. For example set
com.ibm.websphere.naming.hostname.normalizer=com.mycompany.mySpecialHostnameNormalizer
Note that JndiHelper will cache the name of the hostname normalizer class during the first call to a normalizeHostname method, and will not examine the environment for this property on subsequent calls.
env
- Hashtable containing environment properties. If null, this method will
attempt to get an initial context and use its environment.
javax.naming.NamingException
- Any exceptions from the HostnameNormalizer are
returned to the caller.HostnameNormalizer
public static java.lang.String normalizeHostname(java.util.Hashtable env, java.lang.String hostname) throws javax.naming.NamingException
Please see normalizeHostname(Hashtable)
for additional details.
env
- Hashtable containing environment properties. If null, this method
will attempt to get an initial context and use its environment.hostname
- String containing the hostname to normalize. If null, a
NamingException is thrown. If the hostname is not a known host, a
NamingException is thrown with root cause of java.net.UnknownHostException.
javax.naming.NamingException
- Any exceptions from the HostnameNormalizer are returned
to the caller.HostnameNormalizer
public static java.lang.String normalizeHostname(java.util.Hashtable env, java.net.InetAddress ipAddress) throws javax.naming.NamingException
Please see normalizeHostname(Hashtable)
for additional details.
env
- Hashtable containing environment properties. If null, this method
will attempt to get an initial context and use its environment.ipAddress
- java.net.InetAddress representing the hostname to normalize.
If null, a NamingException is thrown.
javax.naming.NamingException
- Any exceptions from the HostnameNormalizer are returned
to the caller.HostnameNormalizer
|
IBM WebSphere Application ServerTM Release 8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |