JBAS-3343
weston.price Jun 28, 2006 2:49 AMThis is a tricky one for a few reasons.
The spec states that the ResourceAdapter should be initialized first, it's properties applied and retained. When the ManagedConnectionFactory is initialized it's properties should be set BUT if a property value is not provided, and it also exists in the ResourceAdapter, the RA property should be applied. The properties used at runtime are a union of the RA and MCF.
We definitely don't do the first one, hence the JIRA task, but we also don't allow for the second condition at all. Typical case would be an RA with the following properties:
RA
ServerName = "localhost"
Port = "8080"
MCF
ServerName = ""
Port = ""
(Yes, yes, stupid example I know)
The spec seems to suggest that the RA values would be applied here in lieu of the MCF providing these values in the descriptor. Otherwise, what would be the point of applying the values from the RA at all? Of course, if any of these were set via *-ds.xml, they would override what has already been applied. After checking *both* the RA and the MCF for the existence of the property.
While we don't recommend modifying the contents of the ra.xml that come with our adapters, clients could most certainly do this. Further the
managed connection factory properties element constructed via XSLT will have to check both the RA and the MCF being that the property could live in both/either place.
Unless I am complicating this scenario, it appears to be a hole that is at presently unaccounted for.
The ConfigPropertyMetaData collections that live off the ConnectorMetaData and ConnectionDefinitionMetaData can actually help. Being that we have both collections at the time of the deployment, I can look for a disjoint between the two. This is of course after implementing equals(), hashCode(). If there are no elements in common then all is well. If there are elements in common, it's a matter of going back to the RA checking if the property was provided, etc, etc.
The strangest edge case would be the following:
RA
FirstProp = ""
MCF
FirstProp = ""
*-ds.xml contains the config-property FirstProp with the appropriate name and type. Now...here is the rub...which one gets set? The RA or the MCF? The spec says that the MCF should take precedence in the case of intersecting names (which is really the only case that matters) but in this scenario, coupled with our deployment, it is not all that clear.
Some of this stuff needed to be cleaned up a bit anyway, so I guess it's a good thing.
Sorry for the long post.