public class InitialContextFactory extends Object
| Constructor and Description |
|---|
InitialContextFactory() |
| Modifier and Type | Method and Description |
|---|---|
static void |
close()
clear all the InitialContext objects.
|
static Context |
getContext(boolean useProps,
String initialContextFactory,
String providerUrl,
boolean useAuth,
String securityPrincipal,
String securityCredentials)
Initialize the JNDI initial context
|
static Context |
lookupContext(String initialContextFactory,
String providerUrl,
boolean useAuth,
String securityPrincipal,
String securityCredentials)
Look up the context from the local cache, creating it if necessary.
|
public static Context lookupContext(String initialContextFactory, String providerUrl, boolean useAuth, String securityPrincipal, String securityCredentials) throws NamingException
initialContextFactory - used to set the property Context.INITIAL_CONTEXT_FACTORYproviderUrl - used to set the property Context.PROVIDER_URLuseAuth - set true if security is to be used.securityPrincipal - used to set the property Context.SECURITY_PRINCIPALsecurityCredentials - used to set the property Context.SECURITY_CREDENTIALSNamingExceptionpublic static Context getContext(boolean useProps, String initialContextFactory, String providerUrl, boolean useAuth, String securityPrincipal, String securityCredentials) throws NamingException
useProps - if true, create a new InitialContext; otherwise use the other parameters to call
lookupContext(String, String, boolean, String, String)initialContextFactory - providerUrl - useAuth - securityPrincipal - securityCredentials - NamingExceptionpublic static void close()
Copyright © 1998-2015 Apache Software Foundation. All Rights Reserved.