org.jboss.jca.core.connectionmanager.ccm

## Class CachedConnectionManagerImpl

- java.lang.Object
- - org.jboss.jca.core.connectionmanager.ccm.CachedConnectionManagerImpl

- All Implemented Interfaces:
    java.util.EventListener, org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager, org.jboss.jca.core.spi.connectionmanager.ComponentStack, org.jboss.jca.core.spi.transaction.usertx.UserTransactionListener

      public class CachedConnectionManagerImpl
      extends java.lang.Object
      implements org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager

  CacheConnectionManager.
  Author:
    Jesper Pedersen

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CachedConnectionManagerImpl(org.jboss.jca.core.spi.transaction.TransactionIntegration transactionIntegration)` Creates a new instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getNumberOfConnections()` Get the number of connections currently in use - if debug is enabled
    `javax.transaction.TransactionManager` | `getTransactionManager()` Gets transaction manager.
    `javax.transaction.TransactionSynchronizationRegistry` | `getTransactionSynchronizationRegistry()` Gets transaction synchronization registry
    `boolean` | `isDebug()` Is debug enabled
    `boolean` | `isError()` Is error enabled
    `boolean` | `isIgnoreUnknownConnections()` Is ignore unknown connections on close enabled
    `java.util.Map<java.lang.String,java.lang.String>` | `listConnections()` List the connections in use - if debug is enabled The return value is the connection key, and its allocation stack trace
    `void` | `popMetaAwareObject(java.util.Set unsharableResources)` Pop a component context
    `void` | `pushMetaAwareObject(java.lang.Object rawKey, java.util.Set unsharableResources)` Push a component context
    `void` | `registerConnection(org.jboss.jca.core.api.connectionmanager.listener.ConnectionCacheListener cm, org.jboss.jca.core.api.connectionmanager.listener.ConnectionListener cl, java.lang.Object connection)` Register connection.
    `void` | `setDebug(boolean v)` Set debug flag
    `void` | `setError(boolean v)` Set error flag
    `void` | `setIgnoreUnknownConnections(boolean v)` Set ignore unknown connections flag
    `void` | `start()` Start
    `void` | `stop()` Stop
    `java.lang.String` | `toString()` String representation
    `void` | `unregisterConnection(org.jboss.jca.core.api.connectionmanager.listener.ConnectionCacheListener cm, org.jboss.jca.core.api.connectionmanager.listener.ConnectionListener cl, java.lang.Object connection)` Unregister connection.
    `void` | `unregisterConnectionCacheListener(ConnectionCacheListener cm)` Describe `unregisterConnectionCacheListener` method here.
    `void` | `userTransactionStarted()` An user transaction has started

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

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

- - ### Constructor Detail

    - #### CachedConnectionManagerImpl

          public CachedConnectionManagerImpl(org.jboss.jca.core.spi.transaction.TransactionIntegration transactionIntegration)

      Creates a new instance.
      Parameters:
        `transactionIntegration` - The transaction integration

  - ### Method Detail

    - #### getTransactionManager

          public javax.transaction.TransactionManager getTransactionManager()

      Gets transaction manager.
      Specified by:
        `getTransactionManager` in interface `org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager`
      Returns:
        transaction manager

    - #### getTransactionSynchronizationRegistry

          public javax.transaction.TransactionSynchronizationRegistry getTransactionSynchronizationRegistry()

      Gets transaction synchronization registry
      Returns:
        TransactionSynchronizationRegistry

    - #### isDebug

          public boolean isDebug()

      Is debug enabled
      Specified by:
        `isDebug` in interface `org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager`
      Returns:
        True if enabled; otherwise false

    - #### setDebug

          public void setDebug(boolean v)

      Set debug flag
      Specified by:
        `setDebug` in interface `org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager`
      Parameters:
        `v` - The value

    - #### isError

          public boolean isError()

      Is error enabled
      Specified by:
        `isError` in interface `org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager`
      Returns:
        True if enabled; otherwise false

    - #### setError

          public void setError(boolean v)

      Set error flag
      Specified by:
        `setError` in interface `org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager`
      Parameters:
        `v` - The value

    - #### isIgnoreUnknownConnections

          public boolean isIgnoreUnknownConnections()

      Is ignore unknown connections on close enabled
      Specified by:
        `isIgnoreUnknownConnections` in interface `org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager`
      Returns:
        True if enabled; otherwise false

    - #### setIgnoreUnknownConnections

          public void setIgnoreUnknownConnections(boolean v)

      Set ignore unknown connections flag
      Specified by:
        `setIgnoreUnknownConnections` in interface `org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager`
      Parameters:
        `v` - The value

    - #### start

          public void start()

      Start
      Specified by:
        `start` in interface `org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager`

    - #### stop

          public void stop()

      Stop
      Specified by:
        `stop` in interface `org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager`

    - #### userTransactionStarted

          public void userTransactionStarted()
                                      throws javax.transaction.SystemException

      An user transaction has started
      Specified by:
        `userTransactionStarted` in interface `org.jboss.jca.core.spi.transaction.usertx.UserTransactionListener`
      Throws:
        `javax.transaction.SystemException` - Thrown in case of an error

    - #### popMetaAwareObject

          public void popMetaAwareObject(java.util.Set unsharableResources)
                                  throws javax.resource.ResourceException

      Pop a component context
      Specified by:
        `popMetaAwareObject` in interface `org.jboss.jca.core.spi.connectionmanager.ComponentStack`
      Parameters:
        `unsharableResources` - a set of real jndi names marked as unshareable
      Throws:
        `javax.resource.ResourceException` - for any error

    - #### registerConnection

          public void registerConnection(org.jboss.jca.core.api.connectionmanager.listener.ConnectionCacheListener cm,
                                         org.jboss.jca.core.api.connectionmanager.listener.ConnectionListener cl,
                                         java.lang.Object connection)

      Register connection.
      Specified by:
        `registerConnection` in interface `org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager`
      Parameters:
        `cm` - connection manager
        `cl` - connection listener
        `connection` - connection handle

    - #### unregisterConnection

          public void unregisterConnection(org.jboss.jca.core.api.connectionmanager.listener.ConnectionCacheListener cm,
                                           org.jboss.jca.core.api.connectionmanager.listener.ConnectionListener cl,
                                           java.lang.Object connection)

      Unregister connection.
      Specified by:
        `unregisterConnection` in interface `org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager`
      Parameters:
        `cm` - connection manager
        `cl` - connection listener
        `connection` - connection handle

    - #### pushMetaAwareObject

          public void pushMetaAwareObject(java.lang.Object rawKey,
                                          java.util.Set unsharableResources)
                                   throws javax.resource.ResourceException

      Push a component context
      Specified by:
        `pushMetaAwareObject` in interface `org.jboss.jca.core.spi.connectionmanager.ComponentStack`
      Parameters:
        `rawKey` - the raw key, e.g. the servlet or ejb context
        `unsharableResources` - a set of real jndi names marked as unshareable
      Throws:
        `javax.resource.ResourceException` - for any error

    - #### unregisterConnectionCacheListener

          public void unregisterConnectionCacheListener(ConnectionCacheListener cm)

      Describe `unregisterConnectionCacheListener` method here. This is a shutdown method called by a connection manager. It will remove all reference to that connection manager from the cache, so cached connections from that manager will never be recoverable. Possibly this method should not exist.
      Parameters:
        `cm` - a `ConnectionCacheListener` value

    - #### getNumberOfConnections

          public int getNumberOfConnections()

      Get the number of connections currently in use - if debug is enabled
      Specified by:
        `getNumberOfConnections` in interface `org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager`
      Returns:
        The value

    - #### listConnections

          public java.util.Map<java.lang.String,java.lang.String> listConnections()

      List the connections in use - if debug is enabled The return value is the connection key, and its allocation stack trace
      Specified by:
        `listConnections` in interface `org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager`
      Returns:
        The map

    - #### toString

          public java.lang.String toString()

      String representation
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        The string

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