[jboss-as7-dev] Validation of writable attribute with alternatives

Jeff Mesnil jmesnil at redhat.com
Thu Apr 19 04:05:59 EDT 2012


Hi,

I had an issue in the messaging subsystem when setting a new value for a 
attribute that requires a AS reload.
In this class[1], we check during the VERIFY step whether the model 
provides an alternative to the attribute that is changed (to rollback 
the operation if that is the case).

The code could be simplified by using a 
ReloadRequiredWriteAttributeHandler except that I don't know where I 
could put the code to validate there is no attribute alternatives.

I can not subclass validateUnresolvedValue(attributeName, 
unresolvedValue) and validateUnresolvedValue(attributeName, 
unresolvedValue) since I don't have access to the resource to check 
whether the attribute has an alternative already defined in the resource.

I can not subclass validateUpdatedModel(context, model) either because I 
don't have access to the name of the attribute that has been updated to 
check if the model makes sense.

Using ReloadRequiredWriteAttributeHandler, is there a place where I can 
check for attribute alternative wrt to the resource?
If not, does it make sense to add a place for this validation (at VERIFY 
or RUNTIME steps)?

thanks,
jeff

[1] 
https://github.com/jbossas/jboss-as/blob/master/messaging/src/main/java/org/jboss/as/messaging/BroadcastGroupWriteAttributeHandler.java#L68

-- 
Jeff Mesnil
JBoss, a division of Red Hat
http://jmesnil.net/


More information about the jboss-as7-dev mailing list