[jboss-jira] [JBoss JIRA] (AS7-4657) Add resolve-expressions param to operation read-resource

Brian Stansberry (JIRA) jira-events at lists.jboss.org
Wed Dec 5 12:25:21 EST 2012


    [ https://issues.jboss.org/browse/AS7-4657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739726#comment-12739726 ] 

Brian Stansberry commented on AS7-4657:
---------------------------------------

I was randomly thinking about this this morning. This comment is a bit of a brain dump:

The problem with adding a parameter to read-resource is the operation is global to all resources (inherited from the root resource), but for many resources the expression resolution is inaccurate. It's inaccurate because, for example, if the user contacts the master HC and says /profile=full/subsystem=web:read-resource(resolve-expressions=true), the master HC can't usefully resolve. The set of environment variables, set of system properties, or security vault the admin expected to be used when they added the expressions are not available on the master HC, they are only available on a running server. So, the "resolve-expressions" parameter is available everywhere, but the correct behavior is not.

A solution to this is a separate operation, e.g. read-resource-resolve or read-resolved-resource. This can be registered only for the resources where its behavior is known to be valid. It can be registered as inherited, so adding it to a few spots in the tree should be sufficient to make it available in great swaths of the tree. It could be registered, for example, at:

1) The root resource for a server, since servers an expression in a server's resource tre  is invalid if it can't be resolved using one of the sources of expression resolution available.
2) The /host=* resource tree on a HostController, since the HC must be able to resolve any expression in that tree.

It's basically the domain-wide config stuff (i.e. from domain.xml) that wouldn't support this operation.
                
> Add resolve-expressions param to operation read-resource
> --------------------------------------------------------
>
>                 Key: AS7-4657
>                 URL: https://issues.jboss.org/browse/AS7-4657
>             Project: Application Server 7
>          Issue Type: Feature Request
>          Components: Domain Management
>            Reporter: Michael Voegele
>              Labels: expression, read-resource
>
> When reading a resource remotely, it would be nice to have the possibility to have expressions resolved.
> Following does of course not work, as the code runs in a separate jvm.
> {code:java}
> private void readRecursive(ModelNode modelNode, String modelNodeName, Map<String, Object> map) {
>    switch (modelNode.getType()) {
>    ...
>    case EXPRESSION:
>    // this would be great but won't work as it runs in a different jvm
>    // ModelNode expression = modelNode.resolve();
>    // readRecursive(expression, modelNodeName, map);
>    map.put(modelNodeName, modelNode.asString());
>    break;
>    ...
> }
> {code}
> Therefore a param resolve-expressions for the read-resource operation would be good.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list