*/
public static DynamicMBean createMBean(ContextResourceLink resourceLink)
throws Exception {
String mname = createManagedName(resourceLink);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
DynamicMBean mbean = managed.createMBean(resourceLink);
ObjectName oname = createObjectName(domain, resourceLink);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);