Element mbeanElement, List<ObjectName> mbeans)
throws Exception
{
// Set configuration to MBeans from XML
MBeanInfo info;
try
{
info = server.getMBeanInfo(objectName);
}
catch (InstanceNotFoundException e)
{
// The MBean is no longer available
throw new DeploymentException("trying to configure nonexistent mbean: " + objectName);
}
catch (Exception e)
{
throw new DeploymentException("Could not get mbeanInfo", JMXExceptionDecoder.decode(e));
} // end of catch
if (info == null)
{
throw new DeploymentException("MBeanInfo is null for mbean: " + objectName);
} // end of if ()
// Get the classloader for loading attribute classes.
ClassLoader cl = server.getClassLoader(loaderName);
// Initialize the mbean using the configuration supplied defaults
MBeanAttributeInfo[] attributes = info.getAttributes();
HashMap<String, MBeanAttributeInfo> attributeMap = new HashMap<String, MBeanAttributeInfo>();
for (int i = 0; i < attributes.length; i++)
{
MBeanAttributeInfo attr = attributes[i];
attributeMap.put(attr.getName(), attr);