org.apache.ws.util.jndi
Class JNDIUtils

java.lang.Object
  extended byorg.apache.ws.util.jndi.JNDIUtils
Direct Known Subclasses:
XmlBeanJndiUtils

public class JNDIUtils
extends java.lang.Object

LOG-DONE A utility class containing methods for setting up the JNDI environment and performing JNDI lookups


Field Summary
static java.lang.String APACHE_INITIAL_CONTEXT_FACTORY
          Apache JNDI Initial Context Factory Prefix
static java.lang.String APACHE_URL_PKG_PREFIX
          Apache JNDI URL Package Prefix
static java.lang.String JNDI_CONFIG
           
 
Constructor Summary
JNDIUtils()
           
 
Method Summary
static javax.naming.Context createSubcontexts(javax.naming.Context currentContext, java.lang.String name)
          Create all intermediate subcontexts.
static java.lang.String getJNDIConfigFileName(org.apache.axis.MessageContext messageContext)
          Get the location of the JNDI configuration file from the deployment descriptor
static javax.naming.Context initializeDir(org.apache.axis.MessageContext msgCtx)
           
static javax.naming.Context initializeFile(org.apache.axis.MessageContext msgCtx)
           
static javax.naming.Context initJNDI()
          Configure JNDI with the Apache Tomcat naming service classes and create the comp and env contexts
static java.lang.Object lookup(javax.naming.Context context, java.lang.String name, java.lang.Class type)
          Retrieves the named object on the specified context.
static void parseJNDIConfig(javax.naming.Context initContext, java.io.InputStream configInput, org.apache.axis.AxisEngine engine)
          Parse the given JNDI configuration and populate the JNDI registry using the parsed configuration
static void parseJNDIConfig(java.io.InputStream configInput)
          Parse the given JNDI configuration and populate the JNDI registry using the parsed configuration
static java.lang.String toString(javax.naming.Context ctx, java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APACHE_URL_PKG_PREFIX

public static final java.lang.String APACHE_URL_PKG_PREFIX
Apache JNDI URL Package Prefix

See Also:
Constant Field Values

APACHE_INITIAL_CONTEXT_FACTORY

public static final java.lang.String APACHE_INITIAL_CONTEXT_FACTORY
Apache JNDI Initial Context Factory Prefix

See Also:
Constant Field Values

JNDI_CONFIG

public static final java.lang.String JNDI_CONFIG
See Also:
Constant Field Values
Constructor Detail

JNDIUtils

public JNDIUtils()
Method Detail

initJNDI

public static javax.naming.Context initJNDI()
                                     throws java.lang.Exception
Configure JNDI with the Apache Tomcat naming service classes and create the comp and env contexts

Returns:
The initial context
Throws:
java.lang.Exception

getJNDIConfigFileName

public static java.lang.String getJNDIConfigFileName(org.apache.axis.MessageContext messageContext)
Get the location of the JNDI configuration file from the deployment descriptor

Parameters:
messageContext - The message context to use for discovering deployment information
Returns:
Location of JNDI configuration file relative to the root of the installation

parseJNDIConfig

public static void parseJNDIConfig(java.io.InputStream configInput)
                            throws java.lang.Exception
Parse the given JNDI configuration and populate the JNDI registry using the parsed configuration

Parameters:
configInput - The configuration stream to parse
Throws:
java.lang.Exception

parseJNDIConfig

public static void parseJNDIConfig(javax.naming.Context initContext,
                                   java.io.InputStream configInput,
                                   org.apache.axis.AxisEngine engine)
                            throws java.lang.Exception
Parse the given JNDI configuration and populate the JNDI registry using the parsed configuration

Parameters:
configInput - The configuration stream to parse
Throws:
java.lang.Exception

lookup

public static java.lang.Object lookup(javax.naming.Context context,
                                      java.lang.String name,
                                      java.lang.Class type)
                               throws javax.naming.NamingException
Retrieves the named object on the specified context. The object returned must be of assignable from the type specified.

Parameters:
context - the context to perform lookup on
name - the name of the object to lookup
type - the expected type of the object returned
Throws:
javax.naming.NamingException

initializeDir

public static javax.naming.Context initializeDir(org.apache.axis.MessageContext msgCtx)
                                          throws java.lang.Exception
Throws:
java.lang.Exception

initializeFile

public static javax.naming.Context initializeFile(org.apache.axis.MessageContext msgCtx)
                                           throws java.lang.Exception
Throws:
java.lang.Exception

toString

public static java.lang.String toString(javax.naming.Context ctx,
                                        java.lang.String name)
                                 throws javax.naming.NamingException
Throws:
javax.naming.NamingException

createSubcontexts

public static javax.naming.Context createSubcontexts(javax.naming.Context currentContext,
                                                     java.lang.String name)
                                              throws javax.naming.NamingException
Create all intermediate subcontexts.

Throws:
javax.naming.NamingException


Copyright © 2004-2005 Apache Software Foundation. All Rights Reserved.