Details

      Description

      In the as4 plugin, we exposed the following trait:

      <metric property="partitionName" dataType="trait" displayType="summary"
      description="the name of the cluster partition this app server instance belongs to"/>

      which we obtained via JMX as follows:

      private String getPartitionName() {
      ObjectNameQueryUtility queryUtility = new ObjectNameQueryUtility(
      "jboss:partitionName=%partitionName%,service=DistributedReplicantManager");
      try {
      List<EmsBean> mBeans = loadConnection().queryBeans(queryUtility.getTranslatedQuery());
      if (mBeans.size() == 1) {
      if (queryUtility.setMatchedKeyValues(mBeans.get(0).getBeanName().getKeyProperties()))

      { return queryUtility.getVariableValues().get("partitionName"); }

      }
      } catch (Exception e)

      { log.error("Could not load partition name as connection could not be loaded"); }

      return null;
      }

      We need this value exposed via some ManagedObject so we can provide the same trait in the as5 plugin.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            brian.stansberry Brian Stansberry added a comment -

            I'll handle this.

            Show
            brian.stansberry Brian Stansberry added a comment - I'll handle this.
            Hide
            brian.stansberry Brian Stansberry added a comment -

            JBBOOT-90 will result in the value the user passed to -g being exposed.

            Show
            brian.stansberry Brian Stansberry added a comment - JBBOOT-90 will result in the value the user passed to -g being exposed.
            Hide
            brian.stansberry Brian Stansberry added a comment -

            JBAS-6094 deals with exposing the HAPartition as a ManagedObject. The partition name is a property on that MO, but, theoretically there could be more than one HAPartition deployed or they could give it a name different from the -g value. Plus, the -g value can be used elsewhere (e.g. makes up part of the JGroups channel name for some JBoss Cache instances). So the combo of JBBOOT-90 and JBAS-6094 covers the bases.

            I'll comment in a bit showing how to get the MO for the HAPartition.

            Show
            brian.stansberry Brian Stansberry added a comment - JBAS-6094 deals with exposing the HAPartition as a ManagedObject. The partition name is a property on that MO, but, theoretically there could be more than one HAPartition deployed or they could give it a name different from the -g value. Plus, the -g value can be used elsewhere (e.g. makes up part of the JGroups channel name for some JBoss Cache instances). So the combo of JBBOOT-90 and JBAS-6094 covers the bases. I'll comment in a bit showing how to get the MO for the HAPartition.
            Hide
            brian.stansberry Brian Stansberry added a comment -

            Accessing the HAPartition MOs:

            There can be more than one HAPartition deployed in an AS, so we use the partitionName property as the MO's name, i.e.

            @ManagementProperty(use=

            {ViewUse.CONFIGURATION}

            , description="The partition's name")
            @ManagementObjectID(type="HAPartition")
            public String getPartitionName()

            { return this.partitionName; }

            So, you can't just look up the HAPartition ManagedComponent via some fixed name. Instead, use the ComponentType:

            ManagementView mgtView = getManagementView();
            ComponentType type = new ComponentType("MCBean", "HAPartition");
            Set<ManagedComponent> hapartitions = mgtView.getComponentsForType(type);
            for (ManagedComponent mc : hapartitions)
            {
            System.out.println("Partition name is " + mc.getProperty("partitionName");
            }

            Show
            brian.stansberry Brian Stansberry added a comment - Accessing the HAPartition MOs: There can be more than one HAPartition deployed in an AS, so we use the partitionName property as the MO's name, i.e. @ManagementProperty(use= {ViewUse.CONFIGURATION} , description="The partition's name") @ManagementObjectID(type="HAPartition") public String getPartitionName() { return this.partitionName; } So, you can't just look up the HAPartition ManagedComponent via some fixed name. Instead, use the ComponentType: ManagementView mgtView = getManagementView(); ComponentType type = new ComponentType("MCBean", "HAPartition"); Set<ManagedComponent> hapartitions = mgtView.getComponentsForType(type); for (ManagedComponent mc : hapartitions) { System.out.println("Partition name is " + mc.getProperty("partitionName"); }
            Hide
            alrubinger Andrew Rubinger added a comment -

            Now in Branch_5_x (not yet trunk):

            +++ ManagedComponent(name=jboss.system:type=ServerConfig, type=(ComponentType

            {type=MCBean, subtype=ServerConfig}

            ), compName=jboss.system:type=ServerConfig, attachment: org.jboss.bootstrap.impl.as.config.BasicJBossASServerConfig
            ++++++ properties: [serverHomeDir, serverLogLocation, udpGroup, homeUrl, serverLogDir, serverDataLocation, homeDir, serverLibraryURL, serverDataDir, bindAddress, nativeLibraryLocation, serverName, commonBaseURL, serverHomeURL, bootstrapURL, serverTempDir, serverNativeDir, partitionName, udpPort, commonLibraryURL, serverBaseDir, serverTempLocation, serverConfLocation, bootLibraryLocation, serverBaseURL]

            Show
            alrubinger Andrew Rubinger added a comment - Now in Branch_5_x (not yet trunk): +++ ManagedComponent(name=jboss.system:type=ServerConfig, type=(ComponentType {type=MCBean, subtype=ServerConfig} ), compName=jboss.system:type=ServerConfig, attachment: org.jboss.bootstrap.impl.as.config.BasicJBossASServerConfig ++++++ properties: [serverHomeDir, serverLogLocation, udpGroup, homeUrl, serverLogDir, serverDataLocation, homeDir, serverLibraryURL, serverDataDir, bindAddress, nativeLibraryLocation, serverName, commonBaseURL, serverHomeURL, bootstrapURL, serverTempDir, serverNativeDir, partitionName, udpPort, commonLibraryURL, serverBaseDir, serverTempLocation, serverConfLocation, bootLibraryLocation, serverBaseURL]

              People

              • Assignee:
                brian.stansberry Brian Stansberry
                Reporter:
                ips Ian Springer
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development