[forge-dev] ejb plugin: how add nested complex annotations to java class?

JFlower fiorenzino at gmail.com
Tue Aug 28 20:47:35 EDT 2012


Hi,

I should add a nested (complex) annotation to MDB class, like this:
@MessageDriven(name = "MDBName", activationConfig = {
 @ActivationConfigProperty(propertyName = "destinationType", propertyValue
= "javax.jms.Queue"),
 @ActivationConfigProperty(propertyName = "destination", propertyValue =
"blah"),
 @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue
= "Auto-acknowledge"),
 @ActivationConfigProperty(propertyName = "maxSession", propertyValue =
"1"),
 @ActivationConfigProperty(propertyName = "transactionTimeout",
propertyValue = "10800"),
 @ActivationConfigProperty(propertyName = "dLQMaxResent", propertyValue =
"0")
})

i can't find something like this in forge code...

I tried with :
JavaClass ejb =((JavaResource) resource).getJavaSource();
ejb.addAnnotation(EjbType.MESSAGEDRIVEN.getAnnotation())
.setStringValue( "name", resource.getName().substring(0,
resource.getName().lastIndexOf(".")))
*.setStringValue( "activationConfig",*
*
      + "\"{ @ActivationConfigProperty(propertyName = \"destinationType\",
propertyValue = \"" + destinationType + "\") "*
* + "@ActivationConfigProperty(propertyName = \"destination\",
propertyValue = \"" + destinationName + "\")}");*

This code does not generate errors, but doesn't add properties to
@MessageDriven annotation.

Someone can help me?

thanks

Fiorenzo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20120829/fe3dd9fc/attachment.html 


More information about the forge-dev mailing list