Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-357

Expose module loading information via the management API

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • 8.0.0.Alpha1
    • None
    • Management
    • None

      The layered distribution changes increase the possibility that a module will be loaded from a location other than the standard spot for modules that ship with the base AS distribution. So we want to expose via the management API information about the possible module loading roots as well as data about the locations from which a given module is loading resources.

      To find the ordered list of module roots, read an attribute from a newly created resource, core-service=module-loading:

      [standalone@localhost:9999 /] /core-service=module-loading:read-attribute(name=module-roots)
      {
          "outcome" => "success",
          "result" => [
              "/Users/bstansberry/dev/jbossas/bootstrap/jboss-as/build/target/jboss-as-8.0.0.Alpha1-SNAPSHOT/modules",
              "/Users/bstansberry/dev/jbossas/bootstrap/jboss-as/build/target/jboss-as-8.0.0.Alpha1-SNAPSHOT/modules/system/layers/base"
          ]
      }
      

      To find the paths from which a module loads resources, invoke an operation on that same resource:

      [standalone@localhost:9999 /] /core-service=module-loading:list-resource-loader-paths(module=org.hibernate)
      {
          "outcome" => "success",
          "result" => [
              "/Users/bstansberry/dev/jbossas/bootstrap/jboss-as/build/target/jboss-as-8.0.0.Alpha1-SNAPSHOT/modules/system/layers/base/org/hibernate/main/hibernate-core-4.2.0.Final.jar",
              "/Users/bstansberry/dev/jbossas/bootstrap/jboss-as/build/target/jboss-as-8.0.0.Alpha1-SNAPSHOT/modules/system/layers/base/org/hibernate/main/hibernate-entitymanager-4.2.0.Final.jar",
              "/Users/bstansberry/dev/jbossas/bootstrap/jboss-as/build/target/jboss-as-8.0.0.Alpha1-SNAPSHOT/modules/system/layers/base/org/hibernate/main/hibernate-infinispan-4.2.0.Final.jar",
              "/Users/bstansberry/dev/jbossas/bootstrap/jboss-as/build/target/jboss-as-8.0.0.Alpha1-SNAPSHOT/modules/system/layers/base/org/hibernate/main/lib"
          ]
      }
      

      The formal description of the above:

      [standalone@localhost:9999 /] /core-service=module-loading:read-resource-description(operations=true,inherited=false)
      {
          "outcome" => "success",
          "result" => {
              "description" => "The modular classloading system.",
              "attributes" => {"module-roots" => {
                  "type" => LIST,
                  "description" => "A list of filesystem locations under which the module loading system looks for modules, arranged in order of precedence.",
                  "expressions-allowed" => false,
                  "nillable" => false,
                  "deprecated" => {
                      "since" => "1.4.0",
                      "reason" => "Experimental and unsupported."
                  },
                  "value-type" => {"module-root" => {
                      "type" => STRING,
                      "description" => "Filesystem location under which the module loading system looks for modules.",
                      "expressions-allowed" => false,
                      "nillable" => false,
                      "min-length" => 1L,
                      "max-length" => 2147483647L
                  }},
                  "access-type" => "read-only",
                  "storage" => "runtime"
              }},
              "operations" => {"list-resource-loader-paths" => {
                  "operation-name" => "list-resource-loader-paths",
                  "description" => "Provides a list of filesystem paths of the module, if there are any.",
                  "request-properties" => {"module" => {
                      "type" => STRING,
                      "description" => "The identifier of the module, in <name>[:<slot>] format. If the slot is not provided, a value of \"main\" is assumed.",
                      "expressions-allowed" => false,
                      "required" => true,
                      "nillable" => false,
                      "min-length" => 1L,
                      "max-length" => 2147483647L
                  }},
                  "reply-properties" => {
                      "type" => LIST,
                      "value-type" => STRING,
                      "description" => "A list, each of whose elements is a filesystem location from which the module can load resources."
                  },
                  "deprecated" => {
                      "since" => "1.4.0",
                      "reason" => "Experimental and unsupported."
                  }
              }},
              "children" => {}
          }
      }
      

              bstansbe@redhat.com Brian Stansberry
              bstansbe@redhat.com Brian Stansberry
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: