org.apache.jmeter.protocol.jms.client

## Class InitialContextFactory

- java.lang.Object
- - org.apache.jmeter.protocol.jms.client.InitialContextFactory

-     public class InitialContextFactory
      extends java.lang.Object

  InitialContextFactory is responsible for getting an instance of the initial context.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `InitialContextFactory()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `close()` clear all the InitialContext objects.
    `static javax.naming.Context` | `getContext(boolean useProps, java.lang.String initialContextFactory, java.lang.String providerUrl, boolean useAuth, java.lang.String securityPrincipal, java.lang.String securityCredentials)` Initialize the JNDI initial context
    `static javax.naming.Context` | `lookupContext(java.lang.String initialContextFactory, java.lang.String providerUrl, boolean useAuth, java.lang.String securityPrincipal, java.lang.String securityCredentials)` Look up the context from the local cache, creating it if necessary.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### InitialContextFactory

          public InitialContextFactory()

  - ### Method Detail

    - #### lookupContext

          public static javax.naming.Context lookupContext(java.lang.String initialContextFactory,
                                                           java.lang.String providerUrl,
                                                           boolean useAuth,
                                                           java.lang.String securityPrincipal,
                                                           java.lang.String securityCredentials)
                                                    throws javax.naming.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 `true` if 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:
        `javax.naming.NamingException` - when creation of the context fails

    - #### getContext

          public static javax.naming.Context getContext(boolean useProps,
                                                        java.lang.String initialContextFactory,
                                                        java.lang.String providerUrl,
                                                        boolean useAuth,
                                                        java.lang.String securityPrincipal,
                                                        java.lang.String securityCredentials)
                                                 throws javax.naming.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 `useProps` is `true`)
        `providerUrl` - url of the provider to use (ignored if `useProps` is `true`)
        `useAuth` - `true` if auth should be used, `false` otherwise (ignored if `useProps` is `true`)
        `securityPrincipal` - name of the principal to (ignored if `useProps` is `true`)
        `securityCredentials` - credentials for the principal (ignored if `useProps` is `true`)
      Returns:
        the context, never `null`
      Throws:
        `javax.naming.NamingException` - when creation of the context fails

    - #### close

          public static void close()

      clear all the InitialContext objects.

Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.