// -------------------- Tomcat callbacks --------------------
private void createMBean( String domain, Object proxy, String name ) {
try {
DynamicMBeanProxy mbean=new DynamicMBeanProxy();
mbean.setReal( proxy );
if( name!=null ) {
mbean.setName( "name=" + name );
}
mbean.registerMBean( domain );
// Set mserver once
if (mserver == null)
mserver = mbean.getMBeanServer();
} catch( Throwable t ) {
log( "Error creating mbean ", t );
}
}