[jboss-jira] [JBoss JIRA] (WFLY-1636) Children coming from a ManagementResourceRegistration.registerOverrideModel() override incorrectly appear as attributes in read-resource-description

Kabir Khan (JIRA) jira-events at lists.jboss.org
Thu Jul 4 08:51:20 EDT 2013


Kabir Khan created WFLY-1636:
--------------------------------

             Summary: Children coming from a ManagementResourceRegistration.registerOverrideModel() override incorrectly appear as attributes in read-resource-description
                 Key: WFLY-1636
                 URL: https://issues.jboss.org/browse/WFLY-1636
             Project: WildFly
          Issue Type: Bug
          Components: Domain Management
    Affects Versions: 8.0.0.Alpha2
            Reporter: Kabir Khan
            Assignee: Kabir Khan
             Fix For: 8.0.0.Alpha3


The problem is in OverrideDescriptionCombiner adding the overridden children to the attributes rather than to the children. For background, this was my initial mail on the subject.
-------
I found this when trying to read the role based access control settings for the whole of WIldFly. I have worked around this with a hack on my https://github.com/kabir/wildfly/commits/rbac-play branch, which is called "Temp commit, work around problems in /subsystem=datasources/data-source=* definition of statistics". The underlying problem seems to be that there is a problem with the resource definition for this attribute/child type. Apart from this there are no other problems when running with standalone-full-ha.xml.

The 'statistics' appears as an attribute when doing a read-resource-description
[standalone at localhost:9990 /] /subsystem=datasources/data-source=ExampleDS:read-resource-description                     
{
   "outcome" => "success",
   "result" => {
       "description" => "A JDBC data-source configuration",
       "attributes" => {
           "share-prepared-statements" => {
               "type" => BOOLEAN,
               "description" => "Whether to share prepared statements, i.e. whether asking for same statement twice without closing uses the same underlying prepared statement",
               "expressions-allowed" => true,
               "nillable" => true,
               "default" => false,
               "access-type" => "read-write",
               "storage" => "configuration",
               "restart-required" => "no-services"
           },
-- SNIP

           "statistics" => {
               "description" => "Runtime statistics provided by the resource adapter.",
               "access-type" => "read-only",
               "storage" => "configuration"
           }
       },
       "operations" => undefined,
       "children" => {"connection-properties" => {
           "description" => "The connection-properties element allows you to pass in arbitrary connection properties to the Driver.connect(url, props) method",
           "model-description" => undefined
       }}
   }
}

However, it does not appears as a child but not as an attribute:

[standalone at localhost:9990 /] /subsystem=datasources/data-source=ExampleDS:read-children-names(child-type=statistics)
{
   "outcome" => "success",
   "result" => [
       "jdbc",
       "pool"
   ]
}[standalone at localhost:9990 /] /subsystem=datasources/data-source=ExampleDS:read-attribute(name=statistics)
{
   "outcome" => "failed",
   "failure-description" => "JBAS014640: 'statistics' is a registered child of resource ([
   (\"subsystem\" => \"datasources\"),
   (\"data-source\" => \"ExampleDS\")
])",
   "rolled-back" => true
}

In read-resource it appears as a child:
[standalone at localhost:9990 /] /subsystem=datasources/data-source=ExampleDS:read-resource(recursive=true, include-runtime=true)
{
   "outcome" => "success",
   "result" => {
---- SNIP ----
       "statistics" => {
           "jdbc" => {
               "PreparedStatementCacheAccessCount" => "0",
               "PreparedStatementCacheAddCount" => "0",
               "PreparedStatementCacheCurrentSize" => "0",
               "PreparedStatementCacheDeleteCount" => "0",
               "PreparedStatementCacheHitCount" => "0",
               "PreparedStatementCacheMissCount" => "0"
           },
           "pool" => {
               "ActiveCount" => "0",
               "AvailableCount" => "20",
               "AverageBlockingTime" => "0",
               "AverageCreationTime" => "0",
               "CreatedCount" => "0",
               "DestroyedCount" => "0",
               "InUseCount" => "0",
               "MaxCreationTime" => "0",
               "MaxUsedCount" => "0",
               "MaxWaitCount" => "0",
               "MaxWaitTime" => "0",
               "TimedOut" => "0",
               "TotalBlockingTime" => "0",
               "TotalCreationTime" => "0"
           }
       }
   }
}
[standalone at localhost:9990 /] /subsystem=datasources/data-source=ExampleDS/statistics=jdbc:read-resource(include-runtime=true)
{
   "outcome" => "success",
   "result" => {
       "PreparedStatementCacheAccessCount" => "0",
       "PreparedStatementCacheAddCount" => "0",
       "PreparedStatementCacheCurrentSize" => "0",
       "PreparedStatementCacheDeleteCount" => "0",
       "PreparedStatementCacheHitCount" => "0",
       "PreparedStatementCacheMissCount" => "0"
   }
}


--
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