users@glassfish.java.net

The power of System properties substitution in Glassfish

From: <glassfish_at_javadesktop.org>
Date: Fri, 28 Mar 2008 01:50:31 PST

Hello,

I wanted just emphasis one point on Glassfish :
The System substitution with the ${word} syntax is very very prowerfull and can be used even in deployement descriptor file and injection code .
We used this to build a dynamic subscription of several cluster on a single queue - a dynamic selector .

For example, the following syntax on a MDB works perfectly :
[i]@MessageDriven(mappedName = "jms/testqueue", activationConfig = {
        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
        @ActivationConfigProperty(propertyName = "destination", propertyValue = "testqueue_at_router1"),
        @ActivationConfigProperty(propertyName = "MessageSelector", propertyValue = " selector_message='[b]${SELECT_VALUE}[/b]'"),
        @ActivationConfigProperty(propertyName = "ConnectionFactoryName", propertyValue = "ConnectionFactory")
    })[/i]
 
If you set different System properties in your cluster configurations for SELECT_VALUE you will be able to have a dynamic selector at a very low price.
Very powerfull !

I think this substitutions are usable for many deployement cases. We already use this for database resources - but i didn't imagine it would work in deployement descriptor and in injection code.

regards,
Olivier
[Message sent by forum member 'omerlin' (omerlin)]

http://forums.java.net/jive/thread.jspa?messageID=266382