JBoss Community

Re: JMX-based monitoring the jbossAS7 database connection pool

created by duan xz in JBoss AS7 Development - View the full discussion

Hi Braun,
Thanks for Response.
but two things is not really clear to me.
1、In order to retrieve the datasource information,
To parse the standalone.xml located in jboss-as-web-7.0.2.Final\standalone\configuration file system  to get data source information?
in standalone.xml Contains the following information:
================================================================================================
<datasource jndi-name="abc" pool-name="H2DS" enabled="true" jta="true" use-java-context="true" use-ccm="true">
                    <connection-url>
                        jdbc:h2:mem:test;DB_CLOSE_DELAY=-1
                    </connection-url>
                    <driver>
                        h2
                    </driver>
                    <pool>
                        <prefill>
                            false
                        </prefill>
                        <use-strict-min>
                            false
                        </use-strict-min>
                        <flush-strategy>
                            FailingConnectionOnly
                        </flush-strategy>
                    </pool>
                    <security>
                        <user-name>
                            sa
                        </user-name>
                        <password>
                            sa
                        </password>
                    </security>
                </datasource>
================================================================================================
2、use “Detyped Description of the AS 7 Management Model" to  retrieve the datasource information.
like this:
==================================
ModelNode op = new ModelNode();
op.get("operation").set("read-resource-description");
op.get("recursive").set(true);
op.get("operations").set(true);
ModelNode address = op.get("address");
address.add("subsystem", "web");
address.add("connector", "http");
==================================
if i want to get all like "<datasource jndi-name =" abc "pool-name =..." node data source name, how to modify the code?

Could you please help me ?


Thanks a lot,

duanxz



Reply to this message by going to Community

Start a new discussion in JBoss AS7 Development at Community