4.7. 激活配置属性
4.7.1. 使用注解配置 MDB
您可以使用 @MessageDriven 元素和对应于 @ ActivationConfigProperty 注释的子元素来配置激活 属性。@ActivationConfigProperty 是 MDB 的一组激活配置属性。@ActivationConfigProperty 注释规范如下:
@Target(value={})
@Retention(value=RUNTIME)
public @interface ActivationConfigProperty
{
String propertyName();
String propertyValue();
}显示 @ActivationConfigProperty 的示例
@MessageDriven(name="MyMDBName",
activationConfig =
{
@ActivationConfigProperty(propertyName="destinationLookup",propertyValue="queueA"),
@ActivationConfigProperty(propertyName = "destinationType",propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
})