users@glassfish.java.net

How do I reconfigure a (JCA 1.6) resource adapter using the supportsDynamicUpdates property of the @ConfigProperty annotation without redeployment?

From: Blank, Julius <julius.blank_at_meditec.zeiss.com>
Date: Tue, 21 Jun 2011 13:40:43 +0200

Hi there,

I just wrote an inbound resource adapter that just opens a socket and
waits for input on a specified port. The port itself is configurable so I
annotated it as follows:

    @ConfigProperty(supportsDynamicUpdates = true)
    private Integer port = 12345;

This way I could configure the port either through my message endpoint
using the @MessageDrivenBean annotation with a @ActivationConfigProperty
like so

@MessageDriven (
        name = "MY_MDB",
        messageListenerInterface = SocketMessageEndpoint.class,
                activationConfig = {_at_ActivationConfigProperty(propertyName
= "port", propertyValue = "54321")})

if needed, otherwise I'll go with the default set above. (I could also use
a deployment descriptor, but one message endpoint is sufficient for us).

This works fine so far, but my problem is:
We want to be able to change the port at runtime without redeploying the
resource adapter (as this would require a redeploy of the client
application as well).

When I went through the JCA 1.6 spec I came across the
supportsDynamicUpdates porperty but unfortunately I was unable to find any
example nor a precise description of how to use that property. In other
words: How can I dynamically update the property annotated this way?

And does glassfish 3.1 support this feature (the spec mentions that it is
not an obligatory feature)?

I'd also love to know about other ways of updating bean properties of my
resource adapter at runtime, so if you have an alternative idea, please
let me know.

If you need more information please let me know, I'll gladly provide you
with what you need.

Thanks in advance for help, best regards,

Julius



----------------------------------------
This message is intended for a particular addressee only and may contain business or company secrets. If you have received this email in error, please contact the sender and delete the message immediately. Any use of this email, including saving, publishing, copying, replication or forwarding of the message or the contents is not permitted.