jsr345-experts@ejb-spec.java.net

[jsr345-experts] Re: MDB improvements?

From: David Blevins <david.blevins_at_gmail.com>
Date: Fri, 9 Dec 2011 08:29:10 -0800

On Sep 25, 2011, at 5:12 PM, Reza Rahman wrote:

> public class SomeBean {
> @Listens
> @ActivationConfigProperty(propertyName="mailServer", propertyValue="mailHost"),
> @ActivationConfigProperty(propertyName="mailFolder", propertyValue="INBOX"),
> @ActivationConfigProperty(propertyName="storeProtocol", propertyValue="imap"),
> @ActivationConfigProperty(propertyName="userName", propertyValue=""),
> @ActivationConfigProperty(propertyName="password", propertyValue="secret")
> public void someMethod(Message message) {
> ...
> }
> }

Side note it would be a bit uglier than that as well:

    @Listens
    @ActivationConfigProperties({
       @ActivationConfigProperty(propertyName="mailServer", propertyValue="mailHost"),
       @ActivationConfigProperty(propertyName="mailFolder", propertyValue="INBOX"),
       @ActivationConfigProperty(propertyName="storeProtocol", propertyValue="imap"),
       @ActivationConfigProperty(propertyName="userName", propertyValue=""),
       @ActivationConfigProperty(propertyName="password", propertyValue="secret")
    })
    public void someMethod(Message message) {
        ...
    }

That said I hope we as a platform get away from "properties" in annotations.


-David