Class InitialContextFactory
java.lang.Object
org.apache.jmeter.protocol.jms.client.InitialContextFactory
InitialContextFactory is responsible for getting an instance of the initial context.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidclose()clear all the InitialContext objects.static ContextgetContext(boolean useProps, String initialContextFactory, String providerUrl, boolean useAuth, String securityPrincipal, String securityCredentials) Initialize the JNDI initial contextstatic ContextlookupContext(String initialContextFactory, String providerUrl, boolean useAuth, String securityPrincipal, String securityCredentials) Look up the context from the local cache, creating it if necessary.
- 
Constructor Details- 
InitialContextFactorypublic InitialContextFactory()
 
- 
- 
Method Details- 
lookupContextpublic static Context lookupContext(String initialContextFactory, String providerUrl, boolean useAuth, String securityPrincipal, String securityCredentials) throws NamingException Look up the context from the local cache, creating it if necessary.- Parameters:
- initialContextFactory- used to set the property- Context.INITIAL_CONTEXT_FACTORY
- providerUrl- used to set the property- Context.PROVIDER_URL
- useAuth- set- trueif security is to be used.
- securityPrincipal- used to set the property- Context.SECURITY_PRINCIPAL
- securityCredentials- used to set the property- Context.SECURITY_CREDENTIALS
- Returns:
- the context, never null
- Throws:
- NamingException- when creation of the context fails
 
- 
getContextpublic static Context getContext(boolean useProps, String initialContextFactory, String providerUrl, boolean useAuth, String securityPrincipal, String securityCredentials) throws NamingException Initialize the JNDI initial context- Parameters:
- useProps- if true, create a new InitialContext; otherwise use the other parameters to call- lookupContext(String, String, boolean, String, String)
- initialContextFactory- name of the initial context factory (ignored if- usePropsis- true)
- providerUrl- url of the provider to use (ignored if- usePropsis- true)
- useAuth-- trueif auth should be used,- falseotherwise (ignored if- usePropsis- true)
- securityPrincipal- name of the principal to (ignored if- usePropsis- true)
- securityCredentials- credentials for the principal (ignored if- usePropsis- true)
- Returns:
- the context, never null
- Throws:
- NamingException- when creation of the context fails
 
- 
closepublic static void close()clear all the InitialContext objects.
 
-