org.sape.carbon.services.ejb
Class InitialContextUtility

java.lang.Object
  |
  +--org.sape.carbon.services.ejb.InitialContextUtility

public class InitialContextUtility
extends Object

This utility class aids in the construction of well-formed InitialContext objects, as required by the EJB service home factories for JNDI lookups.

Copyright 2002 Sapient

Since:
carbon 1.0
Version:
$Revision: 1.6 $($Author: dvoet $ / $Date: 2003/05/05 21:21:27 $)
Author:
Erik M Gottesman, June 2002

Constructor Summary
private InitialContextUtility()
          Private constructor for utility class to block instantiation.
 
Method Summary
static Context getInitialContext(String initialContextFactory, String providerUrl, String principal, String credentials)
          Utility method that creates the InitialContext onto the JNDI tree based upon the configured properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InitialContextUtility

private InitialContextUtility()
Private constructor for utility class to block instantiation.

Method Detail

getInitialContext

public static Context getInitialContext(String initialContextFactory,
                                        String providerUrl,
                                        String principal,
                                        String credentials)
                                 throws NamingException

Utility method that creates the InitialContext onto the JNDI tree based upon the configured properties.

Parameters:
initialContextFactory - String representation of the class name to be used as the InitialContextFactory; this parameter is analagous to Context.INITIAL_CONTEXT_FACTORY
providerUrl - The JNDI provider URL as a Stringl this parameter is analagous to Context.PROVIDER_URL
principal - The security principal as a String; this parameter is analagous to Context.SECURITY_PRINCIPAL
credentials - The credentials associated with the security principal as a String; this parameter is analagous to the Context.SECURITY_CREDENTIALS
Returns:
a new Context based on the given environment.
Throws:
NamingException - indicates an error building the Context based on the given environment.


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.