if (trace)
log.trace("Loading ActivationSpec class=" + className);
Class asClass = Thread.currentThread().getContextClassLoader().loadClass(className);
if (ActivationSpec.class.isAssignableFrom(asClass) == false)
throw new DeploymentException(asClass.getName() + " is not an activation spec class '" + messagingType + "' ra=" + rarName);
ActivationSpec result = (ActivationSpec) asClass.newInstance();
if (trace)
log.trace("Instantiated ActivationSpec class=" + result);
/* Apply the properties to the ActivationSpec java bean using the util
PropertyEditors.mapJavaBeanProperties method.
*/
Properties beanProps = new Properties();
for (Iterator i = activationConfig.iterator(); i.hasNext();)
{
org.jboss.metadata.ActivationConfigPropertyMetaData acpmd = (org.jboss.metadata.ActivationConfigPropertyMetaData) i.next();
String name = acpmd.getName();
String value = acpmd.getValue();
beanProps.setProperty(name, value);
}
if (trace)
log.trace("Configuring ActivationSpec properties=" + beanProps);
try
{
PropertyEditors.mapJavaBeanProperties(result, beanProps);
}
catch(IntrospectionException e)
{
String msg = "Error for ActivationSpec class " + asClass.getName()
+ " as JavaBean";
DeploymentException.rethrowAsDeploymentException(msg, e);
}
// Validate the activation spec
try
{
if (trace)
log.trace("Trying to validate ActivationSpec " + result);
result.validate();
}
catch (UnsupportedOperationException e)
{
log.debug("Validation is not supported for ActivationSpec: " + className);
}