Uploaded image for project: 'Commons DBCP'
  1. Commons DBCP
  2. DBCP-292

Adds an mbean for exposing metrics around a BasicDataSource via JMX

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2.2
    • 2.0
    • None

    Description

      The attached patch adds an mbean that exposes the following metrics of a BasicDataSource via jmx: numActive, numIdle, maxActive, maxIdle, minIdle & maxWait.

      I have put it in a new package: org.apache.commons.dbcp.management but feel free to put it in any package you see fit.

      If using Spring the bean can be configured a little something like this:
      <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
      ...
      </bean>

      <bean id="dataSourceMBean" class="org.apache.commons.dbcp.management.BasicDataSourceMBean">
      <constructor-arg ref="dataSource"/>
      </bean>

      <bean id="mbeanExporter" class="org.springframework.jmx.export.MBeanExporter">
      <property name="beans">
      <map>
      <entry key="DBCP:name=dataSource" value-ref="dataSourceMBean"/>
      </map>
      </property>
      </bean>

      Attachments

        1. BasicDataSourceMBean.patch
          5 kB
          David Horne

        Activity

          People

            Unassigned Unassigned
            dhorne David Horne
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: