org.apache.ignite.cache.jta.jndi

## Class CacheJndiTmFactory

- java.lang.Object
- - org.apache.ignite.cache.jta.jndi.CacheJndiTmFactory

- All Implemented Interfaces:
    Serializable, javax.cache.configuration.Factory<TransactionManager>

      public class CacheJndiTmFactory
      extends Object
      implements javax.cache.configuration.Factory<TransactionManager>

  Implementation of `Factory<TransactionManager>` interface that is using JNDI names to find TM.

  Note that `create()` method iterates by JNDI names and returns the first found `TransactionManager` instance at context.

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CacheJndiTmFactory()` Creates uninitialized jndi TM lookup.
    `CacheJndiTmFactory(String... jndiNames)` Creates generic TM lookup with given jndi names.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TransactionManager` | `create()`
    `Map<?,?>` | `getInitialContextEnvironment()` Gets initial context environment map.
    `String[]` | `getJndiNames()` Gets a list of JNDI names.
    `void` | `setInitialContextEnvironment(Map<?,?> environment)` Sets initial context environment map that will be used in `InitialContext.InitialContext(Hashtable)` constructor.
    `void` | `setJndiNames(String... jndiNames)` Sets JNDI names used by this TM factory.

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

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

- - ### Constructor Detail

    - #### CacheJndiTmFactory

          public CacheJndiTmFactory()

      Creates uninitialized jndi TM lookup.

    - #### CacheJndiTmFactory

          public CacheJndiTmFactory(String... jndiNames)

      Creates generic TM lookup with given jndi names.
      Parameters:
        `jndiNames` - JNDI names that is used to find TM.

  - ### Method Detail

    - #### getJndiNames

          public String[] getJndiNames()

      Gets a list of JNDI names.
      Returns:
        List of JNDI names that is used to find TM.

    - #### setJndiNames

          public void setJndiNames(String... jndiNames)

      Sets JNDI names used by this TM factory.
      Parameters:
        `jndiNames` - JNDI names that is used to find TM.

    - #### getInitialContextEnvironment

          public Map<?,?> getInitialContextEnvironment()

      Gets initial context environment map.
      Returns:
        Initial context environment map.

    - #### setInitialContextEnvironment

          public void setInitialContextEnvironment(Map<?,?> environment)

      Sets initial context environment map that will be used in `InitialContext.InitialContext(Hashtable)` constructor.
      Parameters:
        `environment` - Initial context environment map.

    - #### create

          public TransactionManager create()

      Specified by:
        `create` in interface `javax.cache.configuration.Factory<TransactionManager>`

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.11.0
Release Date | : September 11 2021