Interface ConnectionManagerMBean


  • public interface ConnectionManagerMBean

    Management interface for connection managers. One MBean instance exists per connection manager, whether configured explicitly in server configuration or whether it exists implicitly due to @DataSourceDefinition or @ConnectionFactoryDefinition, or due to the presence of a connection factory or data source in server configuration without an explicitly configured connection manager.

    Important: the mbean instance is not available until the connection factory or data source is first used.

    The object name has the form WebSphere:type=com.ibm.ws.jca.cm.mbean.ConnectionManagerMBean,* where additional attributes can be included to narrow down the connection manager instance.

    Object name examples:
    • WebSphere:type=com.ibm.ws.jca.cm.mbean.ConnectionManagerMBean,jndiName=jdbc/db2,*
      corresponds to a connection manager instance used by a data source with a server configuration-defined JNDI name. For example,
      <dataSource jndiName="jdbc/db2">
       <connectionManager maxPoolSize="10"/>
       ...
      </dataSource>
    • WebSphere:type=com.ibm.ws.jca.cm.mbean.ConnectionManagerMBean,jndiName=eis/cf2,*
      corresponds to a connection manager instance used by a connection factory with a server configuration-defined JNDI name. For example,
      <connectionFactory jndiName="eis/cf2">
       <connectionManager maxPoolSize="10"/>
       ...
      </connectionFactory>
    • WebSphere:type=com.ibm.ws.jca.cm.mbean.ConnectionManagerMBean,name=jmsConnectionFactory[cf1]/connectionManager[default-0],*
      corresponds to a connection manager instance explicitly configured in server configuration as a nested element. For example,
      <jmsConnectionFactory id="cf1">
       <connectionManager maxPoolSize="10"/>
       ...
      </jmsConnectionFactory>
    • WebSphere:type=com.ibm.ws.jca.cm.mbean.ConnectionManagerMBean,name=databaseStore[dbstore1]/dataSource[default-0]/connectionManager[default-0],*
      corresponds to a connection manager instance explicitly configured in server configuration as a nested element. For example,
      <databaseStore id="dbstore1">
       <dataSource>
        <connectionManager maxPoolSize="10"/>
        ...
       </dataSource>
      </databaseStore>
    • WebSphere:type=com.ibm.ws.jca.cm.mbean.ConnectionManagerMBean,name=dataSource[ds1]/connectionManager,*
      corresponds to a connection manager instance implicit from configuration of dataSource in server configuration. For example,
      <dataSource id="ds1">
       ...
      </dataSource>
    • WebSphere:type=com.ibm.ws.jca.cm.mbean.ConnectionManagerMBean,jndiName=java.comp/env/jdbc/ds3,application=MyApp,module=myweb,component=MyTestServlet,*
      corresponds to a connection manager instance implicitly created for data source java:comp/env/jdbc/ds3, which is defined in MyTestServlet in web module myweb in application MyApp. It should be noted that the : character from the JNDI name is replaced by the . character because : is not valid in an object name.
    • WebSphere:type=com.ibm.ws.jca.cm.mbean.ConnectionManagerMBean,jndiName=java.app/env/jdbc/ds4,application=MyApp,*
      corresponds to a connection manager instance implicitly created for data source java:app/env/jdbc/ds4, which is defined in application MyApp. It should be noted that the : character from the JNDI name is replaced by the . character because : is not valid in an object name.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      long getAvailable()
      Displays the free space of the connection pool associated with this Connection Manager as a human readable string.
      java.lang.String getJndiName()
      Returns the JNDI name of the first data source or connection factory that used the connection manager.
      long getMaxSize()
      Displays the maximum size of the connection pool associated with this Connection Manager as a human readable string.
      long getSize()
      Displays the size of the connection pool associated with this Connection Manager as a human readable string.
      void purgePoolContents​(java.lang.String doImmediately)
      Purge the contents of the connection pool associated with this Connection Manager.
      java.lang.String showPoolContents()
      Displays the contents of the connection pool associated with this Connection Manager as a human readable string.
    • Method Detail

      • purgePoolContents

        void purgePoolContents​(java.lang.String doImmediately)
                        throws javax.management.MBeanException
        Purge the contents of the connection pool associated with this Connection Manager.
        Parameters:
        doImmediately - The priority to be used to purge the connection pool. Priority may be "immediate", "abort" or null. Immediate sets the total connection count to 0 and purges the pool as quickly as possible but waits for transactions to complete. Abort purges the pool by aborting connections without waiting for transactions to complete. The default behavior if no value is specified is to purge the pool with normal priority.
        Throws:
        javax.management.MBeanException
      • showPoolContents

        java.lang.String showPoolContents()
        Displays the contents of the connection pool associated with this Connection Manager as a human readable string.
        Returns:
        A non-localized string displaying the current state of the connection pool including detailed information about each shared, unshared and free pool connection, the number of waiters, the total number of connections, and many other details which are useful for monitoring the state of the ConnectionManager and its pool, and debugging problems. Note, this information is not NLS and the format is subject to change.
      • getJndiName

        java.lang.String getJndiName()
        Returns the JNDI name of the first data source or connection factory that used the connection manager. If the first data source or connection factory that used the connection manager does not have a JNDI name, then the String value none is returned.
        Returns:
        A non-localized string displaying a JNDI name or the text none.
      • getMaxSize

        long getMaxSize()
        Displays the maximum size of the connection pool associated with this Connection Manager as a human readable string.
        Returns:
        A long that is maximum size of the connection pool
      • getSize

        long getSize()
        Displays the size of the connection pool associated with this Connection Manager as a human readable string.
        Returns:
        A long that is the size of the connection pool
      • getAvailable

        long getAvailable()
        Displays the free space of the connection pool associated with this Connection Manager as a human readable string.
        Returns:
        A long that is the free space of the connection pool