org.jboss.jca.core.connectionmanager.pool.strategy

## Class PoolBySubject

- java.lang.Object
- - org.jboss.jca.core.connectionmanager.pool.AbstractPool
  - - org.jboss.jca.core.connectionmanager.pool.AbstractPrefillPool
    - - org.jboss.jca.core.connectionmanager.pool.strategy.PoolBySubject

- All Implemented Interfaces:
    org.jboss.jca.core.api.connectionmanager.pool.Pool, PrefillPool

      public class PoolBySubject
      extends AbstractPrefillPool

  Pool implementation that uses subject.
  Author:
    Gurkan Erdogdu, Jesper Pedersen

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PoolBySubject(javax.resource.spi.ManagedConnectionFactory mcf, org.jboss.jca.core.api.connectionmanager.pool.PoolConfiguration pc, boolean noTxSeparatePools, boolean sharable, java.lang.String mcp)` Creates a new instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected javax.security.auth.Subject` | `createSubject(org.jboss.jca.core.spi.security.SubjectFactory subjectFactory, java.lang.String securityDomain, javax.resource.spi.ManagedConnectionFactory mcf, java.lang.String jndiName)` Create a subject
    `protected java.lang.Object` | `getKey(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cri, boolean separateNoTx)` Retrieve the key for this request.
    `CoreLogger` | `getLogger()` Get the logger
    `boolean` | `testConnection()` Test if a connection can be obtained
    `boolean` | `testConnection(javax.resource.spi.ConnectionRequestInfo cri, javax.security.auth.Subject subject)` Test if a connection can be obtained

    - ### Methods inherited from class org.jboss.jca.core.connectionmanager.pool.AbstractPrefillPool

      `isPrefill, prefill`

    - ### Methods inherited from class org.jboss.jca.core.connectionmanager.pool.AbstractPool

      `cancelShutdown, dumpQueuedThreads, emptyManagedConnectionPool, findConnectionListener, findConnectionListener, flush, flush, flush, getCapacity, getConnection, getConnectionManager, getInternalStatistics, getLock, getManagedConnectionFactory, getManagedConnectionPool, getManagedConnectionPools, getName, getPoolConfiguration, getStatistics, getTransactionIntegration, getTransactionManager, getTransactionSynchronizationRegistry, hasConnection, internalTestConnection, isFIFO, isFull, isIdle, isInterleaving, isSharable, isShutdown, prepareShutdown, returnConnection, setCapacity, setConnectionManager, setInterleaving, setName, shutdown`

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

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

    - ### Methods inherited from interface org.jboss.jca.core.connectionmanager.pool.api.Pool

      `cancelShutdown, emptyManagedConnectionPool, findConnectionListener, findConnectionListener, getCapacity, getConnection, getInternalStatistics, getLock, getManagedConnectionFactory, hasConnection, isFIFO, isFull, isIdle, isInterleaving, isSharable, isShutdown, prepareShutdown, returnConnection, setCapacity, setConnectionManager, setInterleaving, setName, shutdown`

    - ### Methods inherited from interface org.jboss.jca.core.api.connectionmanager.pool.Pool

      `dumpQueuedThreads, flush, flush, flush, getName, getStatistics`

- - ### Constructor Detail

    - #### PoolBySubject

          public PoolBySubject(javax.resource.spi.ManagedConnectionFactory mcf,
                               org.jboss.jca.core.api.connectionmanager.pool.PoolConfiguration pc,
                               boolean noTxSeparatePools,
                               boolean sharable,
                               java.lang.String mcp)

      Creates a new instance.
      Parameters:
        `mcf` - managed connection factory
        `pc` - pool configuration
        `noTxSeparatePools` - notx seperate pool
        `sharable` - Are the connections sharable
        `mcp` - mcp

  - ### Method Detail

    - #### getKey

          protected java.lang.Object getKey(javax.security.auth.Subject subject,
                                            javax.resource.spi.ConnectionRequestInfo cri,
                                            boolean separateNoTx)
                                     throws javax.resource.ResourceException

      Retrieve the key for this request.
      Specified by:
        `getKey` in class `AbstractPool`
      Parameters:
        `subject` - the subject
        `cri` - the connection request information
        `separateNoTx` - separateNoTx
      Returns:
        the key
      Throws:
        `javax.resource.ResourceException` - for any error

    - #### testConnection

          public boolean testConnection()

      Test if a connection can be obtained
      Specified by:
        `testConnection` in interface `org.jboss.jca.core.api.connectionmanager.pool.Pool`
      Specified by:
        `testConnection` in class `AbstractPool`
      Returns:
        True if it was possible to get a connection; otherwise false

    - #### testConnection

          public boolean testConnection(javax.resource.spi.ConnectionRequestInfo cri,
                                        javax.security.auth.Subject subject)

      Test if a connection can be obtained
      Specified by:
        `testConnection` in interface `org.jboss.jca.core.api.connectionmanager.pool.Pool`
      Specified by:
        `testConnection` in class `AbstractPool`
      Parameters:
        `cri` - Optional connection request info object
        `subject` - Optional subject
      Returns:
        True if it was possible to get a connection; otherwise false

    - #### createSubject

          protected javax.security.auth.Subject createSubject(org.jboss.jca.core.spi.security.SubjectFactory subjectFactory,
                                                              java.lang.String securityDomain,
                                                              javax.resource.spi.ManagedConnectionFactory mcf,
                                                              java.lang.String jndiName)

      Create a subject
      Parameters:
        `subjectFactory` - The subject factory
        `securityDomain` - The security domain
        `mcf` - The managed connection factory
        `jndiName` - The jndi-name
      Returns:
        The subject; `null` in case of an error

    - #### getLogger

          public CoreLogger getLogger()

      Get the logger
      Specified by:
        `getLogger` in class `AbstractPool`
      Returns:
        The value

Copyright © 2014 IronJacamar (http://www.ironjacamar.org)