BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(hibernateStatisticsServiceName, StatisticsService.class.getName());
StringBuffer buffer = new StringBuffer();
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();
builder.addAnnotation(jmxAnnotation);
controller.install(builder.getBeanMetaData(), hibernateStatisticsService);
}
// Handle JNDI binding....
bind();