This class is not declared in the AS7 plugin descriptor. It is a tool that that plugin developers may use while writing their own plugin to monitor their application MBeans.
The custom plugin must:
The resource type using this class (or a subclass of this class) as a discovery component must indicate which type of server it runs inside. It may be either a JBossAS7 Standalone Server or a Managed Server.
Plugins authors are required to provide a resource key and name and mayprovide a resource description and version by declaring plugin configuration properties of the following names:
Alternatively, they can subclass create a subclass of this discovery component and override one/some/all of the following methods:
By default, application MBeans will be searched with an EMS query defined in the plugin descriptor by the {@link PluginConfigProps#BEANS_QUERY_STRING} plugin-config property.
It is also possible to define the query string in a subclass overriding the {@link #getBeansQueryString(org.rhq.core.domain.configuration.Configuration)} method.
Plugin developers can implement their custom MBeans lookup method in a subclass overriding the {@link #hasApplicationMBeans(org.rhq.core.domain.configuration.Configuration,org.mc4j.ems.connection.EmsConnection)}method.
The JMX server host will be detected by looking at the top level server resource plugin configuration ( {@link org.rhq.modules.plugins.jbossas7.StandaloneASComponent} and {@link org.rhq.modules.plugins.jbossas7.HostControllerComponent}). The JMX port detection mechanism depends on the parent resource.
For AS7 and EAP6 servers, the discovery component will look at the management port defined in the parent {@link org.rhq.modules.plugins.jbossas7.StandaloneASComponent} plugin configuration and add the value of {@link #STANDALONE_REMOTING_PORT_OFFSET}.
For Wildfly8 servers, the discovery component will look at the management port defined in the parent {@link org.rhq.modules.plugins.jbossas7.StandaloneASComponent} plugin configuration.
For AS7 and EAP6 servers, the discovery component will use {@link #DOMAIN_REMOTING_PORT_DEFAULT} plus the port offset of the managed server.
For Wildfly8 servers, the discovery component will use {@link #HTTP_PORT_DEFAULT} plus the port offset of the managed server.
JMX connectivity on AS7 and EAP6 requires authentication and standalone and managed servers behaviors differ.
In standalone mode, the server will use the ManagementRealm, just as for HTTP management interface authentication. Consequently, this class will pick up the credentials of the management user defined in the plugin configuration of the parent server resource ( {@link org.rhq.modules.plugins.jbossas7.StandaloneASComponent}).
In other words, plugin authors have nothing to do.
In domain mode, the server will use the ApplicationRealm. Consequently, there is no way for the discovery component to discover credentials automatically and it will use "rhqadmin:rhqadmin" by default.
When working with managed servers, plugin developers should subclass the discovery component and override the {@link #getCredentialsForManagedAS()} method. For example, an implementation could lookup the credentials in atext file.
<plugin name="MyappMBeansPlugin" displayName="Myapp MBeans Plugin" package="com.myapp.services.plugin" xmlns="urn:xmlns:rhq-plugin" xmlns:c="urn:xmlns:rhq-configuration"> <depends plugin="JBossAS7" useClasses="true"/> <service name="Myapp Services" discovery="org.rhq.modules.plugins.jbossas7.jmx.ApplicationMBeansDiscoveryComponent" class="org.rhq.modules.plugins.jbossas7.jmx.ApplicationMBeansComponent" description="Container for Myapp Services" singleton="true"> <runs-inside> <!-- The type of the server the application is running on --> <parent-resource-type name="JBossAS7 Standalone Server" plugin="JBossAS7"/> <parent-resource-type name="Managed Server" plugin="JBossAS7"/> </runs-inside> <plugin-configuration> <c:simple-property name="beansQueryString" readOnly="true" default="myapp:service=*"/> <c:simple-property name="newResourceKey" readOnly="true" default="myappServices"/> <c:simple-property name="newResourceName" readOnly="true" default="Myapp Services"/> <c:simple-property name="newResourceDescription" readOnly="true" default="Container for Myapp Services"/> </plugin-configuration> <!-- ApplicationMBeansComponent can be the parent of any JMXComponent (JMX plugin). For example, it's possible to monitor a MBean with no line of Java code thanks to the MBeanResourceComponent facility. Plugin authors only have to configure metrics (mapped to MBeans attributes) and operations (MBeans operations). --> <service name="HelloService" discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent" class="org.rhq.plugins.jmx.MBeanResourceComponent" singleton="true"> <plugin-configuration> <c:simple-property name="objectName" default="myapp:service=HelloService" readOnly="true"/> </plugin-configuration> <operation name="helloTo"> <parameters> <c:simple-property name="p1" displayName="somebody" type="string" required="true"/> </parameters> <results> <c:simple-property name="operationResult" type="string"/> </results> </operation> </service> </service> </plugin>@author Thomas Segismont @see ApplicationMBeansComponent
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|