value = parseJbxbSerialData(attr, cl, element, replace, trim);
else
value = parseTextSerialData(attr, cl, element, replace, trim);
log.debug(attributeName + " set to " + value + " in " + objectName);
setAttribute(objectName, new Attribute(attributeName, value));
}//if has children
}
//end of "attribute
else if (element.getTagName().equals("depends"))
{
if (!element.hasChildNodes())
{
throw new DeploymentException("No ObjectName supplied for depends in " + objectName);
}
String mbeanRefName = element.getAttribute("optional-attribute-name");
if ("".equals(mbeanRefName))
mbeanRefName = null;
else
mbeanRefName = StringPropertyReplacer.replaceProperties(mbeanRefName);
String proxyType = element.getAttribute("proxy-type");
if ("".equals(proxyType))
proxyType = null;
else
proxyType = StringPropertyReplacer.replaceProperties(proxyType);
// Get the mbeanRef value
ObjectName dependsObjectName = processDependency(objectName, loaderName, element, mbeans, replace);
log.debug("considering " + ((mbeanRefName == null) ? "<anonymous>" : mbeanRefName.toString()) + " with object name " + dependsObjectName);
if (mbeanRefName != null)
{
Object attribute = dependsObjectName;
if (proxyType != null)
{
if (mbeanRefName == null)
throw new DeploymentException("You cannot use a proxy-type without an optional-attribute-name");
if (proxyType.equals("attribute"))
{
MBeanAttributeInfo attr = attributeMap.get(mbeanRefName);
if (attr == null)
throw new DeploymentException("No Attribute found with name: " + mbeanRefName);
proxyType = attr.getType();
}
Class proxyClass = cl.loadClass(proxyType);
attribute = MBeanProxyExt.create(proxyClass, dependsObjectName,
server, true);
}
//if if doesn't exist or has wrong type, we'll get an exception
setAttribute(objectName, new Attribute(mbeanRefName, attribute));
} // end of if ()
}
//end of depends
else if (element.getTagName().equals("depends-list"))
{
String dependsListName = element.getAttribute("optional-attribute-name");
if ("".equals(dependsListName))
{
dependsListName = null;
} // end of if ()
NodeList dependsList = element.getChildNodes();
ArrayList<ObjectName> dependsListNames = new ArrayList<ObjectName>();
for (int l = 0; l < dependsList.getLength(); l++)
{
if (dependsList.item(l).getNodeType() != Node.ELEMENT_NODE)
{
continue;
}
Element dependsElement = (Element) dependsList.item(l);
if (dependsElement.getTagName().equals("depends-list-element"))
{
if (!dependsElement.hasChildNodes())
{
throw new DeploymentException("Empty depends-list-element!");
} // end of if ()
// Get the depends value
ObjectName dependsObjectName = processDependency(objectName, loaderName, dependsElement, mbeans, replace);
if (!dependsListNames.contains(dependsObjectName))
{
dependsListNames.add(dependsObjectName);
} // end of if ()
}
} // end of for ()
if (dependsListName != null)
{
setAttribute(objectName, new Attribute(dependsListName, dependsListNames));
} // end of if ()
}//end of depends-list
}
}