Skip Navigation Links | |
Exit Print View | |
Oracle GlassFish Server 3.1 Add-On Component Development Guide |
1. Introduction to the Development Environment for GlassFish Server Add-On Components
3. Extending the Administration Console
4. Extending the asadmin Utility
5. Adding Monitoring Capabilities
Defining Statistics That Are to Be Monitored
Defining an Event Provider by Writing a Java Class
Defining Event Types in an Event Provider Class
Example of Defining an Event Provider by Writing a Java Class
Defining an Event Provider by Writing an XML Fragment
Packaging a Component's Event Providers
Updating the Monitorable Object Tree
Representing a Component's Statistics in an Event Listener Class
Subscribing to Events From Event Provider Classes
Example of Adding Monitoring Capabilities
6. Adding Configuration Data for a Component
7. Adding Container Capabilities
8. Creating a Session Persistence Module
9. Packaging, Integrating, and Delivering an Add-On Component
The GlassFish Server administrative commands get(1), list(1), and set(1) locate a statistic through the dotted name of the statistic. The dotted name of a statistic for an add-on component is determined from the registration of the event listener that defines the statistic as follows:
listener-parent-node.path-to-statistic.statistic-name
The node in the monitorable object tree under which the event listener that defines the statistic is registered. This node is passed in the invocation of the register method that registers the event listener. For more information, see Registering an Event Listener.
The path through the monitorable object tree from the node under which the event listener is registered down to the statistic in the event listener in which each slash is replaced with a period. This path is passed in the invocation of the register method that registers the event listener. For more information, see Registering an Event Listener.
The name of the statistic. This name is the value of the id element of the @ManagedAttribute annotation on the property that represents the statistic. For more information, see Representing a Component's Statistics in an Event Listener Class.
For example, the dotted name of the txcount statistic that is defined in Example 5-5 and registered in Example 5-7 is as follows:
server.applications.tx.txapp.txcount
The formats of the URL to a REST resource that represents a statistic is as follows:
http://host:port/monitoring/domain/path
The host where the DAS is running.
The HTTP port or HTTPS port for administration.
The path to the statistic. The path is the dotted name of the attribute in which each dot (.) is replaced with a slash (/).
For example, the URL the REST resource for the txcount statistic that is defined in Example 5-5 and registered in Example 5-7 is as follows:
http://localhost:4848/monitoring/domain/server/applications/tx/txapp/txcount
In this example, the DAS is running on the local host and the HTTP port for administration is 4848.