ArrayList<ActivationConfigProperty> properties = new ArrayList<ActivationConfigProperty>();
if (mdb.isJMS())
{
if (mdb.getAcknowledgeMode() != null)
properties.add(new ActivationConfigPropertyImpl("acknowledgeMode", mdb.getAcknowledgeMode()));
if(mdb.getMessageDestinationType() != null)
{
properties.add(new ActivationConfigPropertyImpl("destinationType", mdb.getMessageDestinationType()));
}
SubscriptionDurability subscriptionDurability = mdb.getSubscriptionDurability();
if(subscriptionDurability != null)
{
String durable = "false";
if (subscriptionDurability.equals(SubscriptionDurability.Durable))
durable = "true";
properties.add(new ActivationConfigPropertyImpl("subscriptionDurability", durable));
if (subscriptionDurability.equals(SubscriptionDurability.Durable))
properties.add(new ActivationConfigPropertyImpl("subscriptionName", "subscriptionName"));
}
// prefer jndi name over message destination link
if (mdb.getDestinationJndiName() != null)
{
properties.add(new ActivationConfigPropertyImpl("destination", mdb
.getDestinationJndiName()));
}
else if(mdb.getMessageDestinationLink() != null)
{
log.warn("Message destination link on a MDB is not yet implemented, specify a jndi name in jboss.xml");
/*
// TODO: I can't resolve here, because we're still scanning, maybe this will work:
// This will be picked up by MessagingContainer and then resolved to a jndi name
properties.add(new ActivationConfigPropertyImpl("destinationLink", mdb.getMessageDestinationLink()));
*/
}
if (mdb.getMdbSubscriptionId() != null)
{
properties.add(new ActivationConfigPropertyImpl("subscriptionName", mdb
.getMdbSubscriptionId()));
}
// FIXME These properties are only for our jmsra.rar
if (mdb.getMdbUser() != null)
{
properties.add(new ActivationConfigPropertyImpl("user", mdb
.getMdbUser()));
}
if (mdb.getMdbPassword() != null)
{
properties.add(new ActivationConfigPropertyImpl("password", mdb
.getMdbPassword()));
}
}
ActivationConfigMetaData activationConfig = mdb.getActivationConfig();
if (activationConfig != null && activationConfig.getActivationConfigProperties() != null)
{
for (ActivationConfigPropertyMetaData property : activationConfig.getActivationConfigProperties())
{
properties.add(new ActivationConfigPropertyImpl(property
.getName(), property.getValue()));
}
}
ActivationConfigPropertyImpl[] propsArray = new ActivationConfigPropertyImpl[properties