[jboss-as7-dev] Detyped API document feedback
Heiko W.Rupp
hrupp at redhat.com
Tue Jan 4 16:17:36 EST 2011
Am 04.01.2011 um 18:02 schrieb David M. Lloyd:
>
> ========
>
> MetaValues
>
> I agree with some of these types but not others:
>
> * SimpleValue
> + String - yes
I am not sure if wrapping simple objects brings a lot of benefits.
Wrapping/unwrapping adds typing, complexity and cpu usage.
Composing like in the example of SimpleValue<String,int> socket;
makes sense though.
>
> I'd rather do something more dynamic where you can start with a node and
> just build up whatever you want from it:
>
> node = new ModelNode();
> node.get("operation").set("change-bind-port"); // string
> node.get("address").add("base, "domain"); // a list
> node.get("address").add("profile", "web");
> node.get("address").add("subsystem", "web");
> node.get("address").add("connector", "ssl");
> node.get("bind-port").set(8433); // int
> result = connection.execute(node); // goes over remoting
> System.out.println("Result is: " + result);
> // nicely formatted, JSON-style (but with more possible types)
I like this - if there is a way to introspect the node in order
to know what it would expect (i.E. is it 'bind-port' or 'port' or 'bindPort' ?)
Now add this to a versioned rest endpoint
/1/setFoobar/#44
and the api can partially be updated later with new versions of the endpoint
/2/setFooBar++/#44
> MetaTypes
>
> I gotta be honest, I'm not liking this API. I don't see this as
I am lucky it is not only me :-)
> something users will consider to be a huge advantage over JMX. I know
> there are notes in here about improving user-friendliness but I do not
A big issue in previous AS versions is/was that most information exposed via
JMX (in standard MBeans) was without any semantic
- operation foo(String, String, String)
- operation foo(String, int, Float)
What are the expected arguments?
> The registry of operations should be external to the model itself; it
> would be a map with a key that corresponds to the operation name plus a
> "path" specification to the applicable node type.
Did I understand you correctly that the path is not in the key?
I think it is also important to be able to navigate to model elements
over this path (think xpath expresssion) and to be able to directly
address an element /domain1/server14/hornetq/queue1/queue_lenght
>
> {
> "operation-name" => "change-bind-port",
> "address" => [
> ("base"=>"domain"),
> ("profile"=>"*"),
> ("subsystem"=>"web"),
> ("connector"=>"*"),
> ],
> "request-properties" => {
> "bind-port" => {
> type => INTEGER,
> required => true,
> min-value => 0,
> max-value => 65535,
> }
> },
> "reply-properties" => {}
> }
Yep
Heiko
--
Reg. Adresse: Red Hat GmbH, Otto-Hahn-Strasse 20, 85609 Dornach bei München
Handelsregister: Amtsgericht München HRB 153243
Geschaeftsführer: Brendan Lane, Charlie Peters, Michael Cunningham, Charles Cachera
More information about the jboss-as7-dev
mailing list