users@glassfish.java.net

Post Deployment Configuration of MDB using JCA Inbound Socket Resource

From: <forums_at_java.net>
Date: Tue, 20 Dec 2011 13:09:22 -0600 (CST)

 I have a message driven bean that is being invoked from data received on a
TCP socket via a JCA Resource Adapter in a GlassFish 3.1.1 application
server. The deployment descriptor in the sun-ejb-jar.xml file, specifies the
URL and port of the socket. When the MDB is deployed, I see the app server
execute the endpointActivation() method in the resource adapter with the
MessageEndpointFactory and ActivationSpec as parameters.

This works fine when the URL and port are known before deployment and can be
specified in the XML file, but now I need the ability to change the TCP
socket during runtime in my EJB code. I couldn't find any references in the
JCA spec about how to do this during runtime.

For reference, I downloaded the specification from Oracle's
website. www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-eeplat-419426.html#J2EE_CONNECTOR-1.5-FR-SPEC-G-F
[1]

Basically, I'd like to move the following XML code that populates the
ActivationSpec into my EJB code.

<sun-ejb-jar> <enterprise-beans> <ejb>
<ejb-name>MyInboundSocketMDB</ejb-name> <mdb-resource-adapter>
<resource-adapter-mid>jca-sockets-rar</resource-adapter-mid>
<activation-config> <activation-config-property>
<activation-config-property-name>url</activation-config-property-name>
<activation-config-property-value>localhost</activation-config-property-value>
</activation-config-property> <activation-config-property>
<activation-config-property-name>port</activation-config-property-name>
<activation-config-property-value>5006</activation-config-property-value>
</activation-config-property> </activation-config> </mdb-resource-adapter>
</ejb> </enterprise-beans> </sun-ejb-jar>

[1]
http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-eeplat-419426.html#J2EE_CONNECTOR-1.5-FR-SPEC-G-F

--
[Message sent by forum member 'cerebrus']
View Post: http://forums.java.net/node/875933