大体、ほとんどのMiddleWareは既にサーポートしている
★Hibernate
----------------------------------
When you are not using Spring or JBoss then things are a little more hands on when it comes to JMX monitoring of Hibernate.
You need to do the following:
In your Hibernate Configuration add:
<property name="hibernate.generate_statistics">true</property>
Then in a startup segment of your app you need to register the MBeans with the MBean server:
MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();
ObjectName objectName = new ObjectName("org.hibernate:type=statistics");
StatisticsService mBean = new StatisticsService();
mBean.setStatisticsEnabled(true);
mBean.setSessionFactory(sessionFactory);
mbeanServer.registerMBean(mBean, objectName);
------------------------------------
★C3P0
he registration of the c3p0 MBean is actually done within c3p0 itself and we have no control over this behavior.
What you can do is specify the following system property:
-Dcom.mchange.v2.c3p0.management.ManagementCoordinator=com.mchange.v2.c3p0.management.NullManagementCoordinator
ObjectName com.mchange.v2.c3p0:type=C3P0Registry
ClassName com.mchange.v2.c3p0.management.C3P0RegistryManager
属性:
NumPooledDataSources
mBeanServer.getMBeanInfo(new ObjectName("com.mchange.v2.c3p0:type=C3P0Registry"));
★jconsoleで各BEAN、BEANの属性を確認して取る