Raible's Wiki
Raible Designs AppFuseHomepage- Korean - Chinese - Italian - Japanese QuickStart Guide User Guide Tutorials Other ApplicationsStruts ResumeSecurity Example Struts Menu
Set your name in
UserPreferences
Referenced by
JSPWiki v2.2.33
Hide Menu |
This is version 1.
It is not the current version, and thus it cannot be edited. Here are some instructions for making the Hibernate Statistics JMX MBean available from AppFuse: The example below has been tested with MX4J 3.0.1, JDK 1.5 Update 2 and Tomcat 5.5.7. Inside StartupListener.java add: import org.hibernate.jmx.*; import javax.management.*; import java.lang.management.ManagementFactory; try { SessionFactory sessionFactory = (SessionFactory)applicationContext.getBean("sessionFactory"); MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer(); ObjectName on = new ObjectName("Hibernate:type=statistics,application=appfuse"); StatisticsService mBean = new StatisticsService(); mBean.setStatisticsEnabled(true); mBean.setSessionFactory(sessionFactory); mbeanServer.registerMBean(mBean, on); } catch (Exception e) { log.error("Error registering Hibernate StatisticsService [" + e.getMessage() + "]", e); } After starting up AppFuse, you should be able to attach to the server using JConsole. From there, you should see the Hibernate MBean where you can view the statistics that have been collected. How useful is this? Not sure yet! -:) Attachments:
|