if (raProperties != null && raProperties.size() != 0)
{
for (Iterator i = raProperties.iterator(); i.hasNext();)
{
ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData) i.next();
String name = cpmd.getName();
String value = cpmd.getValue();
if (value != null && value.length() > 0)
{
if (properties.containsKey(name))
{
if (trace)
log.trace("AdminObject '" + jndiName + "' property=" + name + " IGNORING value=" + value
+ " specified in MBean properties.");
}
else
{
// Load the property class as defined in the meta data
String typeName = cpmd.getType();
if (trace)
log.trace("AdminObject '" + jndiName + "' property=" + name + " loading class=" + typeName);
try
{
configPropertyHandler.handle(cpmd);
}
catch (InvocationTargetException e)
{
DeploymentException.rethrowAsDeploymentException("Error for property '" + name + "' class="
+ implClass + "' for admin object '" + interfaceClass + "' ra=" + rarName, e
.getTargetException());
}
catch (Throwable t)
{
DeploymentException.rethrowAsDeploymentException("Error for property '" + name + "' class="
+ implClass + "' for admin object '" + interfaceClass + "' ra=" + rarName, t);
}
}
}
}
}
// Apply the properties
if (properties != null)
{
for (Iterator i = properties.entrySet().iterator(); i.hasNext();)
{
Map.Entry property = (Map.Entry) i.next();
String name = (String) property.getKey();
String value = (String) property.getValue();
if (trace)
log.trace("AdminObject '" + jndiName + "' property=" + name + " value=" + value);
// Pick up the property metadata
ConfigPropertyMetaData cpmd = aomd.getProperty(name);
if (cpmd == null)
throw new DeploymentException("No property '" + name + "' for admin object '" + interfaceClass + "' ra="
+ rarName);
// Make copy of the ConfigPropertyMetaData with new value
ConfigPropertyMetaData cpmdCopy = new ConfigPropertyMetaData();
cpmdCopy.setName(name);
cpmdCopy.setType(cpmd.getType());
cpmdCopy.setValue(value);
try
{
configPropertyHandler.handle(cpmdCopy);
}