[jboss-as7-dev] Description provider duplication example acme-subsystem

David Bosschaert david at redhat.com
Tue Jul 26 04:38:00 EDT 2011


Hi Kabir,

Looking at the example acme-subsystem in [1] I noticed that there are 2 
decription providers that contain the same attribute description. Once 
in the TypeAddHandler and another one in SubsystemProviders.TYPE_CHILD. 
They describe exactly the same property - the code seems to be copied. I 
see that they are used in 2 places, the TypeAddHandler description is 
used in registerOperationHandler() while SubsystemProviders.TYPE_CHILD 
is used in the registerSubModel() call.

Is this duplication intentional/needed?

Thanks,

David

BTW here's the duplicated code:
public ModelNode getModelDescription(Locale locale) {
     ModelNode node = new ModelNode();
     node.get(DESCRIPTION).set("Contains information about a tracked 
deployment type");
     node.get(ATTRIBUTES, "tick", DESCRIPTION).set("How often in 
milliseconds to output the information about the tracked deployments");
     node.get(ATTRIBUTES, "tick", TYPE).set(ModelType.LONG);
     node.get(ATTRIBUTES, "tick", REQUIRED).set(true);
     node.get(ATTRIBUTES, "tick", DEFAULT).set(10000);
     return node;
}

[1] https://docs.jboss.org/author/display/AS7/Extending+JBoss+AS+7


More information about the jboss-as7-dev mailing list