Iterator<Element> iterator = MetaData.getChildrenByTagName(activationConfig, "activation-config-property");
while (iterator.hasNext())
{
Element xml = iterator.next();
org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData md = new org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData();
ActivationConfigPropertyMetaData metaData = new ActivationConfigPropertyMetaData(md);
String name = MetaData.getElementContent(MetaData.getUniqueChild(xml, "activation-config-property-name"));
String value = MetaData.getElementContent(MetaData.getUniqueChild(xml, "activation-config-property-value"));
if (name == null || name.trim().length() == 0)
throw new DeploymentException("activation-config-property doesn't have a name");
if (Strings.isValidJavaIdentifier(name) == false)
throw new DeploymentException("activation-config-property '" + name + "' is not a valid java identifier");
md.setName(name);
md.setValue(value);
if (properties.containsKey(metaData.getName()) == false)
properties.put(metaData.getName(), metaData);
}
}
// Message Destination Link
String link = metaData.getDestinationLink();
if (link != null)
{
link = link.trim();
if (link.length() > 0)
{
if (properties.containsKey("destination"))
log.warn("Ignoring message-destination-link '" + link + "' when the destination " +
"is already in the activation-config.");
else
{
MessageDestinationMetaData destinationMetaData = container.getMessageDestination(link);
if (destinationMetaData == null)
throw new DeploymentException("Unresolved message-destination-link '" + link + "' no message-destination in ejb-jar.xml");
String jndiName = destinationMetaData.getJndiName();
if (jndiName == null)
throw new DeploymentException("The message-destination '" + link + "' has no jndi-name in jboss.xml");
org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData acpmd = new
org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData();
acpmd.setActivationConfigPropertyName("destination");
acpmd.setValue(jndiName);
ActivationConfigPropertyMetaData wrapper = new ActivationConfigPropertyMetaData(acpmd);
properties.put("destination", wrapper);
}
}
}
}