[jboss-cvs] JBossAS SVN: r94798 - trunk/hibernate-int/src/main/java/org/jboss/hibernate/jmx.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 13 17:38:16 EDT 2009
Author: alesj
Date: 2009-10-13 17:38:16 -0400 (Tue, 13 Oct 2009)
New Revision: 94798
Modified:
trunk/hibernate-int/src/main/java/org/jboss/hibernate/jmx/Hibernate.java
Log:
Enable @JMX via type.
Modified: trunk/hibernate-int/src/main/java/org/jboss/hibernate/jmx/Hibernate.java
===================================================================
--- trunk/hibernate-int/src/main/java/org/jboss/hibernate/jmx/Hibernate.java 2009-10-13 21:30:41 UTC (rev 94797)
+++ trunk/hibernate-int/src/main/java/org/jboss/hibernate/jmx/Hibernate.java 2009-10-13 21:38:16 UTC (rev 94798)
@@ -25,7 +25,6 @@
import java.net.URL;
import java.util.Date;
import java.util.Properties;
-
import javax.naming.InitialContext;
import javax.naming.NamingException;
@@ -38,6 +37,7 @@
import org.hibernate.jmx.StatisticsServiceMBean;
import org.hibernate.transaction.JBossTransactionManagerLookup;
import org.hibernate.transaction.JTATransactionFactory;
+import org.jboss.aop.microcontainer.aspects.jmx.JMX;
import org.jboss.beans.metadata.api.annotations.Inject;
import org.jboss.beans.metadata.api.model.FromContext;
import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
@@ -217,11 +217,10 @@
hibernateStatisticsService.setSessionFactory( sessionFactory );
BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(hibernateStatisticsServiceName, StatisticsService.class.getName());
StringBuffer buffer = new StringBuffer();
- buffer.append("@org.jboss.aop.microcontainer.aspects.jmx.JMX(name=\"").append(hibernateStatisticsServiceName).append("JMX\"");
+ buffer.append("@").append(JMX.class.getName()).append("(name=\"").append(hibernateStatisticsServiceName).append("JMX\"");
buffer.append(", exposedInterface=").append(StatisticsServiceMBean.class.getName()).append(".class, registerDirectly=true)");
String jmxAnnotation = buffer.toString();
- // todo - add the @JMX into annotations
- //builder.addAnnotation(jmxAnnotation);
+ builder.addAnnotation(jmxAnnotation);
controller.install(builder.getBeanMetaData(), hibernateStatisticsService);
}
More information about the jboss-cvs-commits
mailing list