Agreed, it would be better if populateModel returned <T> and
performRuntime took a <T> as a param. But that would need to be done in
a new base class, as this is already a widely used API.
Hardest part about it is coming up with a nice name for the new base
class, since the existing one has the obvious name. ;-)
On 7/22/11 7:44 AM, David Bosschaert wrote:
Thanks Emanuel,
I was trying to stay as close as possible to [1] but this is of course a
solution.
We might update the doc to mention it...
Cheers,
David
[1]
https://docs.jboss.org/author/display/AS7/Extending+JBoss+AS+7
On 22/07/2011 13:07, Emanuel Muckenhuber wrote:
> There is no need to subclass this handler. I'd suggest you use the
> OperationStepHandler interface directly and add the 5 lines this handler
> does. At least that's what i'm doing.
>
> On 07/22/2011 01:03 PM, David Bosschaert wrote:
>> Hi all,
>>
>> While I'm writing a bunch of AbstractAddStepHandler subclasses for the
>> parsing of my subsystem I was thinking the following...
>>
>> Typically these have the following methods:
>> protected void populateModel(ModelNode operation, ModelNode model) {
>> // parse data out of operation and put into model
>> }
>>
>> protected void performRuntime(OperationContext context, ModelNode
>> operation, ModelNode model,...) {
>> // take action, which typically means:
>> // read data out of model and do something with it
>> }
>>
>> This typically means that I have to parse the stuff in performRuntime
>> again (from ModelNode->native objects), either out of model or reparse
>> the operation. It would be nice if the result of the parsing in
>> populateModel could be cached somehow so that you could re-use it in
>> performRuntime?
>>
>> Any ideas here? Is this already possible? Or should I be doing things
>> differently?
>>
>> Cheers,
>>
>> David
>> _______________________________________________
>> jboss-as7-dev mailing list
>> jboss-as7-dev(a)lists.jboss.org
>>
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
> _______________________________________________
> jboss-as7-dev mailing list
> jboss-as7-dev(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
_______________________________________________
jboss-as7-dev mailing list
jboss-as7-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev