On 08/05/2014 02:42 AM, Heiko Braun wrote:
TL;DR: A proposal for improving parts of the management API that
deal with static resource definitions
Background:
For future Wildfly versions we plan to re-architect the management console to make better
use the existing meta data. The goal is to provide a data binding layer that automates
much of the retrieval and update of the configuration and runtime data. To achieve this
goal, we need to remove some of the roadblocks that prevent further automation. This is
the first of a series of posts that explains some of the challenges we facing and a
proposal to improve the situation.
Problem:
Typically we deal with resources that addressable through a key value pair, where the key
of the tuple depicts the type of the resource and the value the name or identify of a
specific resource instance, i.e.:
/subsystem=datasources/data-source=ExampleDS
In this case 'ExampleDS' is the name of a resource of type 'data-source'.
The type is associated with a specific resource definition, that's typically retrieved
through the :read-resource-description operation. In the following sections I am going to
refer to these resource as 'regular' resources.
In some situations, it seems more feasible (and valid) to construct a model
representation without instance names, i.e.:
/subsystem=ejb3/service=[async | remote | timer-service]
We've solved this a different way in the "next" management model. We
introduce the concept of an "attribute group". In your example we'd
perhaps have an attribute group for async, one for remote, and one for
timer-service within the root resource.
An attribute group is something like a composition resource. They can
be optional or mandatory, and they can be named or anonymous.
A named attribute group would be separately addressable as a unit, or
can be accessed using a qualifier syntax e.g. "thegroup.theattribute".
Also they can be arbitrarily nested.
An anonymous attribute group is just a logical grouping which is only
relevant to the server Java API itself and is invisible to the so-called
"DMR" or REST style API. We can use these groups to retrofit existing
subsystems without breaking compatibility (this gives certain code reuse
benefits which are not important to this discussion).
This way we preserve the invariant that all attributes with a given key
have a related type (we also introduce the concept of type hierarchies
though, which mitigates this constraint in a different way, but that's
not related to this).
--
- DML