Interface JDBCResourceConnectionPoolManagementMBean


  • public interface JDBCResourceConnectionPoolManagementMBean

    The JDBCResourceConnectionPoolManagementMBean interface provides methods to modify the configuration settings of a JDBC resource’s connection pool.

    The JMX Object Name of a JDBCResourceConnectionPoolManagementMBean can be obtained from a PersistenceManagementMBean.

    Since:
    Rhino 2.5.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String MBEAN_NAME
      The name of MBeans of this type, equal to the string "JdbcResourceConnectionPool".
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Notify the SLEE that the JDBCResourceConnectionPoolManagementMBean is no longer required by the management client.
      CompositeData getConfiguration()
      Get a description of the connection pool configuration.
      long getConnectionPoolTimeout()
      Get the connection pool timeout.
      int getIdleCheckInterval()
      Get the time between idle connection discard checks.
      int getMaxConnections()
      Get the maximum total number of connections that can exist at any one time.
      int getMaxIdleConnections()
      Get the maximum number of idle connections that can exist at any one time.
      int getMaxIdleTime()
      Get the time a connection can be idle for before becoming eligible for discard.
      int getMinConnections()
      Get the minimum total number of connections that should exist at any one time.
      void setConnectionPoolTimeout​(long timeout)
      Set the connection pool timeout.
      void setIdleCheckInterval​(int idleCheckInterval)
      Set the time between idle connection discard checks.
      void setMaxConnections​(int maxConnections)
      Set the maximum total number of connections that can exist at any one time.
      void setMaxIdleConnections​(int maxIdleConnections)
      Set the maximum number of idle connections that can exist at any one time.
      void setMaxIdleTime​(int maxIdleTime)
      Set the time period after which an idle connection may become eligible for discard.
      void setMinConnections​(int minConnections)
      Set the minimum total number of connections that should exist at any one time.
      void setParameters​(Map<String,​Object> parameters)
      Bulk set a number of connection pool configuration parameters.
    • Field Detail

      • MBEAN_NAME

        static final String MBEAN_NAME

        The name of MBeans of this type, equal to the string "JdbcResourceConnectionPool".

        Since:
        Rhino 2.5.0
        See Also:
        Constant Field Values
    • Method Detail

      • getMaxConnections

        int getMaxConnections()
                       throws ConfigurationException

        Get the maximum total number of connections that can exist at any one time.

        Returns:
        the maximum total number of connections that can exist.
        Throws:
        ConfigurationException - if the operation fails due to a configuration error.
        Since:
        Rhino 2.5.0
      • setMaxConnections

        void setMaxConnections​(int maxConnections)
                        throws ConfigurationException

        Set the maximum total number of connections that can exist at any one time. This includes pooled, establishing, and in-use connections.

        Parameters:
        maxConnections - the maximum total number of connections. This value must be greater than 0 and greater than or equal to getMaxIdleConnections().
        Throws:
        ConfigurationException - if the operation fails due to a configuration error.
        Since:
        Rhino 2.5.0
      • getMinConnections

        int getMinConnections()
                       throws ConfigurationException

        Get the minimum total number of connections that should exist at any one time.

        Returns:
        the minimum total number of connections.
        Throws:
        ConfigurationException - if the operation fails due to a configuration error.
        Since:
        Rhino 2.5.0
      • setMinConnections

        void setMinConnections​(int minConnections)
                        throws ConfigurationException

        Set the minimum total number of connections that should exist at any one time. The idle connection pool will be initially populated with this many connections. The total number of in-use and idle connections will (generally) never decrease below the value set for this property.

        Parameters:
        minConnections - the minimum total number of connections that should exist.. This value must be at least 0 and less than or equal to getMaxIdleConnections().
        Throws:
        ConfigurationException - if the operation fails due to a configuration error.
        Since:
        Rhino 2.5.0
      • getMaxIdleConnections

        int getMaxIdleConnections()
                           throws ConfigurationException

        Get the maximum number of idle connections that can exist at any one time.

        Returns:
        the maximum number of idle connections.
        Throws:
        ConfigurationException - if the operation fails due to a configuration error.
        Since:
        Rhino 2.5.0
      • setMaxIdleConnections

        void setMaxIdleConnections​(int maxIdleConnections)
                            throws ConfigurationException

        Set the maximum number of idle connections that can exist at any one time. In-use connections that become idle when there are already this number of idle connections will be discarded.

        Parameters:
        maxIdleConnections - the maximum number of idle connections. This value must be at least 0, less than or equal to getMaxConnections(), and greater than or equal to getMinConnections()
        Throws:
        ConfigurationException - if the operation fails due to a configuration error.
        Since:
        Rhino 2.5.0
      • getMaxIdleTime

        int getMaxIdleTime()
                    throws ConfigurationException

        Get the time a connection can be idle for before becoming eligible for discard.

        Returns:
        the maximum idle time, measured in seconds.
        Throws:
        ConfigurationException - if the operation fails due to a configuration error.
        Since:
        Rhino 2.5.0
      • setMaxIdleTime

        void setMaxIdleTime​(int maxIdleTime)
                     throws ConfigurationException

        Set the time period after which an idle connection may become eligible for discard. Note that an idle connection will not be discarded if it would reduce the number of idle connections below getMinConnections().

        Parameters:
        maxIdleTime - the maximum idle time, measured in seconds. This value must be at least 0, with 0 meaning that idle connections will never be discarded for this reason.
        Throws:
        ConfigurationException - if the operation fails due to a configuration error.
        Since:
        Rhino 2.5.0
      • getIdleCheckInterval

        int getIdleCheckInterval()
                          throws ConfigurationException

        Get the time between idle connection discard checks. This value only has meaning if getMaxIdleTime() is greater than 0.

        Returns:
        the idle connection discard check period, measured in seconds.
        Throws:
        ConfigurationException - if the operation fails due to a configuration error.
        Since:
        Rhino 2.5.0
      • setIdleCheckInterval

        void setIdleCheckInterval​(int idleCheckInterval)
                           throws ConfigurationException

        Set the time between idle connection discard checks. This value only has meaning if getMaxIdleTime() is greater than 0.

        Parameters:
        idleCheckInterval - the idle connection discard check period, measured in seconds. This value must be greater than 0.
        Throws:
        ConfigurationException - if the operation fails due to a configuration error.
        Since:
        Rhino 2.5.0
      • getConnectionPoolTimeout

        long getConnectionPoolTimeout()
                               throws ConfigurationException

        Get the connection pool timeout.

        Returns:
        the connection pool timeout, measured in milliseconds.
        Throws:
        ConfigurationException - if the operation fails due to a configuration error.
        Since:
        Rhino 2.5.0
      • setConnectionPoolTimeout

        void setConnectionPoolTimeout​(long timeout)
                               throws ConfigurationException

        Set the connection pool timeout. This value is the maximum time that a SLEE application requesting a connection will block before a timeout error occurs.

        Parameters:
        timeout - the connection pool timeout, measured in milliseconds. This value must be greater than or equal to 0.
        Throws:
        ConfigurationException - if the operation fails due to a configuration error.
        Since:
        Rhino 2.5.0
      • setParameters

        void setParameters​(Map<String,​Object> parameters)
                    throws ConfigurationException

        Bulk set a number of connection pool configuration parameters.

        The parameters argument is a map who’s keys are property names (case insensitive) and values are the values to be assigned to the corresponding property. The legal property names and the expected type of their respective property value are given in the table below:

        Property name (case insensitive) Property value type

        max-connections

        java.lang.Integer

        min-connections

        java.lang.Integer

        max-idle-connections

        java.lang.Integer

        max-idle-time

        java.lang.Integer

        idle-check-interval

        java.lang.Integer

        connection-pool-timeout

        java.lang.Long

        Parameters:
        parameters - a map of the configuration to set, as given above.
        Throws:
        ConfigurationException - if an unrecognised configuration parameter is included, a configuration parameter is given an invalid value, the final set of configuration properties fails a validation check, or the operation fails due to an internal configuration error.
        Since:
        Rhino 2.5.0
      • close

        void close()
            throws ConfigurationException

        Notify the SLEE that the JDBCResourceConnectionPoolManagementMBean is no longer required by the management client. As the SLEE may subsequently deregister the MBean from the MBean server, a client that invokes this method should assume that the Object Name they had for the MBean is no longer valid once this method returns.

        Throws:
        ConfigurationException - if the operation fails due to a system-level failure.
        Since:
        Rhino 2.5.0