private static ServiceInstance installEmbeddedXMBean(MBeanServer server, ObjectName objectName, ServiceMetaData metaData) throws Exception
{
ObjectName loaderName = metaData.getClassLoaderName();
ClassLoader loader = server.getClassLoader(loaderName);
String code = metaData.getCode();
ServiceConstructorMetaData constructor = metaData.getConstructor();
// This is an xmbean with an embedded mbean descriptor
log.debug("About to create xmbean object: " + objectName + " with code: " + code + " with embedded descriptor");
//xmbean: construct object first.
Object resource = server.instantiate(code,
loaderName,
constructor.getParameters(loader),
constructor.getSignature());
String xmbeanCode = metaData.getXMBeanCode();
Element mbeanDescriptor = metaData.getXMBeanDescriptor();
Object[] args = { resource, mbeanDescriptor, ServiceConstants.PUBLIC_JBOSSMX_XMBEAN_DTD_1_0 };
String[] sig = { Object.class.getName(), Element.class.getName(), String.class.getName() };