Dear XDoclet developers,

I'm trying to create a patch for an additional feature in the IBM WebSphere module.

IBM Websphere offers the possibility to specify additional properties for a Resource-Reference in a proprietary deployment descriptor (i.e. the transaction isolation level).

I thought that i could add a "websphere.resource-ref" Tag for the additional WebSphere proprietary parameters. As a bean may declare multiple Resource-References, the tags could look like this:

/*
 * @ejb.resource-ref
 *   res-ref-name="DS1"
 * @websphere.resource-ref
 *   res-ref-name="DS1"
 *   transaction-isolation="TRANSACTION_READ_COMMITTED"
 *
 * @ejb.resource-ref
 *  res-ref-name="DS2"
 * @websphere.resource-ref
 *   res-ref-name="DS2"
 *   transaction-isolation="TRANSACTION_READ_UNCOMMITTED"
 */

The generated deployment descriptors for this example should look similar to the snippets below. It's important to notice that the Elements in the WebSphere proprietary descriptors are links to the Elements in the ejb-jar.xml with the ID attribute and not with the res-ref-name.

ejb-jar.xml:
<resource-ref id="ResRef_12>
  <res-ref-name>DS1<res-ref-name>
  ...
</resource-ref>
<resource-ref id="ResRef_13>
  <res-ref-name>DS2<res-ref-name>
  ...
</resource-ref>

WebSphere proprietary descriptor (names may be wrong) :
<resource-ref-ext>
  <resource-ref href="ejb-jar.xml#ResRef_12"/>
  <transactionIsolation>TRANSACTION_READ_COMMITTED</transactionIsolation>
</resource-ref-ext>

<resource-ref-ext>
  <resource-ref href="ejb-jar.xml#ResRef_12"/>
  <transactionIsolation>TRANSACTION_READ_COMMITTED</transactionIsolation>
</resource-ref-ext>


I thought, that i could loop through the "ejb.resource-ref" tags and create a <resource-ref-ext> element in the WebSphere DD for each ejb.resource-ref tag. If i use the same prefix for generating the id as the ejb Module, i should be able to get the correct ID for the href Attribute. If there is a "websphere.resource-ref" tag with the same "res-ref-name" parameter value as the "res-ref-name" of the current "ejb.resource-ref" tag, the values from this tag are inserted into the WebSphere DD element.


The essential part of my WebSphere DD Template looks like below. I try to use the match variable for storing the "res-ref-name".

<XDtClass:forAllClassTags tagName="ejb.resource-ref" >
<resource-ref-ext>
<resource-ref href="ejb-jar.xml#<XDtId:prefixedId prefix='ResRef' wrapInIdEquals='false'/>"/>
<XDtClass:classTagValueMatch tagName="ejb.resource-ref" paramName="res-ref-name"/>
<XDtClass:forAllClassTags tagName="websphere.resource-ref" >
<XDtClass:ifClassTagValueMatches tagName="websphere.resource-ref" paramName="res-ref-name">
<XDtClass:ifHasClassTag tagName="websphere.resource-ref" paramName="transaction-isolation">
...


This does not work because the forAllClassTags resets the value of the match variable (see method forAllClassTags in class xdoclet.tagshandler.ClassTagsHandler). Therefore, a "transaction-isolation" element is never created.

Is there a better approach than mine?

Is it the right approach to use the match variable for saving the value of the "res-ref-name"?

Why does the ClassTagsHandler reset the value of the match variable in the forAllClassTags method?

I found similar code in the jboss module (modules/jboss/src/xdoclet/modules/jboss/jmx/resources/jbossmx-xml-descriptor.xdt)

I have not tested the code, but i think that it does not work because it uses the same pattern as i try to use.

Thanks for your help.

Regards,
Matthias







--
Matthias Germann <[EMAIL PROTECTED]>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to