[jboss-as7-dev] Do new model attributes require manual setup of transformers?
Jaikiran Pai
jpai at redhat.com
Tue Mar 5 10:14:22 EST 2013
On Tuesday 05 March 2013 08:24 PM, Kabir Khan wrote:
> On 5 Mar 2013, at 14:23, Jaikiran Pai wrote:
>
>> I've been trying to implement a new feature which requires the addition
>> of a new model attribute for the EJB3 subsystem root resource. This
>> model attribute is supposed to be "mandatory" (i.e. non-nullable at
>> model level and "required" at xml level). All works fine without
>> bringing into picture older versions of the model. Now while testing
>> with older versions of the model and compatibility, things start failing
>> for obvious reasons- the older model handlers, parsers etc... have no
>> clue about this new attribute. I'm aware that that's where the
> The old parsers should make it possible to construct the current model. Is the new attribute something which is now configurable, so you have two choices whereas previously one of those choices was assumed? In that case I think the old parser should create the resulting operation with the assumed default.
The new (xml and model) attribute that I'm introducing is for EJB 3.2
spec support. This attribute had no semantics in the previous model
versions. So this is a completely new one in terms of semantics.
>> subsystems and resources introducing a new attribute in the
>> higher model would expect that that attribute to be ignored (I'm not
>> using the term discarded or rejected because I am not 100% sure I
>> understand the difference yet :) ) by lower versions of the model.
> discard = silently discard the attribute
> reject = if the attribute is used/does not have some value/is defined/other conditions the transformation should fail
>
> Normally we prefer reject. So for your case, again assuming that the added attribute has some assumed value in the old version, you should fail transformation if the current model does not have that assumed value.
Sorry, my initial mail didn't have the attribute specifics. This new
attribute is a EJB 3.2 specific thing so I think "discard" would be
applicable in this case.
If it helps, I've pushed a WIP implementation here [1]. That one uses a
"reject" (since I pushed it before I saw your reply) and it fails in the
EJB3SubsystemUnitTestCase (2 tests fail which I haven't been able to
understand yet).
[1]
https://github.com/jaikiran/jboss-as/commits/ejb-3.2-sfsb-disable-passivation
- the new attribute in question is this
https://github.com/jaikiran/jboss-as/commit/3fe390d39256eeac06c682ef8ea06f6759b7e443#L1R120
and the model equivalent is
https://github.com/jaikiran/jboss-as/commit/3fe390d39256eeac06c682ef8ea06f6759b7e443#L10R246.
By the way, I'd to fix the ModelTestUtil support to make sure some of
the other tests in that testcase pass
https://github.com/jaikiran/jboss-as/commit/3fe390d39256eeac06c682ef8ea06f6759b7e443#L20R537
-Jaikiran
More information about the jboss-as7-dev
mailing list