org.sape.carboncontrib.jndi
Class InitialContextHelper

java.lang.Object
  extended byorg.sape.carboncontrib.jndi.InitialContextHelper

public class InitialContextHelper
extends Object

A helper class to create InitialContext objects required for JNDI lookups.


Field Summary
private static org.apache.commons.logging.Log log
           
private static String providerConfigName
           
 
Constructor Summary
InitialContextHelper()
          Private Constructor: Don't let anyone instantiate this class
 
Method Summary
static InitialContext getInitialContext(User user, String jndiProviderName)
          Gets the JNDI initial context for the supplied provider name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

providerConfigName

private static final String providerConfigName
See Also:
Constant Field Values
Constructor Detail

InitialContextHelper

public InitialContextHelper()
Private Constructor: Don't let anyone instantiate this class

Method Detail

getInitialContext

public static InitialContext getInitialContext(User user,
                                               String jndiProviderName)
                                        throws NamingException
Gets the JNDI initial context for the supplied provider name.

Parameters:
user - the user object for authenticating to the JNDI service. If this parameter is null, the behaviour is determined by the JNDI service provider.
jndiProviderName - the name of the JNDI provider whose services are desired. If this parameter is set to null, you will get an InitialContext to the JNDI provider on the local server. JNDI provider names and their properties are stored in /jndi/jndi-providers.xml.
Returns:
InitialContext the initial context
Throws:
InvalidConfigurationException - if any required configration value does not exist.
NamingException - if there is any NamingException


Copyright 2003 Sapient Corporation. All Rights Reserved.