Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The accepted answer doesn't really tell you how to do this. If you use Spring, a possible solution is to use the <code>MethodNameBasedMBeanInfoAssembler</code> and list the methods on <code>BasicDataSource</code> you require to be exposed. Assuming you have a bean configured with id <code>dataSource</code> add this to your <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/html/beans.html#beans-factory-instantiation" rel="nofollow noreferrer">Spring XML config</a>:</p> <pre><code>&lt;bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean"&gt; &lt;property name="locateExistingServerIfPossible" value="true" /&gt; &lt;/bean&gt; &lt;bean id="mbeanExporter" class="org.springframework.jmx.export.MBeanExporter"&gt; &lt;property name="assembler"&gt; &lt;bean class="org.springframework.jmx.export.assembler.MethodNameBasedMBeanInfoAssembler"&gt; &lt;property name="managedMethods"&gt; &lt;list&gt; &lt;value&gt;getNumActive&lt;/value&gt; &lt;value&gt;getMaxActive&lt;/value&gt; &lt;value&gt;getNumIdle&lt;/value&gt; &lt;value&gt;getMaxIdle&lt;/value&gt; &lt;value&gt;getMaxWait&lt;/value&gt; &lt;value&gt;getInitialSize&lt;/value&gt; &lt;/list&gt; &lt;/property&gt; &lt;/bean&gt; &lt;/property&gt; &lt;property name="beans"&gt; &lt;map&gt; &lt;entry key="dataSource:name=DataSource" value-ref="dataSource"/&gt; &lt;/map&gt; &lt;/property&gt; &lt;property name="server" ref="mbeanServer" /&gt; &lt;/bean&gt; &lt;/beans&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload