Question

I'm trying to write a JCA resource adapter. In the ra.xml I have added entries for custom properties such as:

<config-property>
    <config-property-name>UserName</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
</config-property>

When I load the resource adapter in WebSphere these entries show up under the custom properties of the RA. It is possible to edit and save these values and WebSphere reloads them after a restart.

How does the resource adapter itself read access these values however? I'm guessing it involves injection and annotations or something but I can't seem to find anything that simply explains how it is supposed to work.

Thanks,

Was it helpful?

Solution

If you write message adapter you can check out jca-sockets project. It contains example, which clearly describe how to read configuration properties. You should specify activationspec xml tag in ra.xml descriptor:

      <activationspec>
        <activationspec-class>bla.bla.bla.BlaActivationSpec</activationspec-class>
        <required-config-property>
          <description>Bla Activation property</description>
          <config-property-name>bla</config-property-name>
        </required-config-property>
      </activationspec>

bla.bla.bla.BlaActivationSpec is a POJO class that provides getters and setters to properties.

But seems this method works only for message adapters and it is interesting how to read properties for outbound adapter... Now I am trying to find this out.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top