Defines the event that triggers the action associated with a management rule.
Predefined events are provided with the Enterprise Server. You can configure these events by changing event element attributes and properties.
You can create custom events by creating custom MBeans that implement the JMX NotificationEmitter interface. For more information about MBeans, see the Sun GlassFish Enterprise Server 2.1 Developer’s Guide and http://java.sun.com/javase/6/docs/api/javax/management/package-summary.html. For information about monitor MBeans, see http://java.sun.com/javase/6/docs/api/javax/management/monitor/package-summary.html.
If multiple rules are associated with the same event, ordering of action execution is not guaranteed.
The following table describes subelements for the event element.
Table 1–56 event Subelements
Element |
Required |
Description |
---|---|---|
zero or one |
Contains a text description of this element. |
|
zero or more |
Specifies a property or a variable. |
The following table describes attributes for the event element.
Table 1–57 event Attributes
Attribute |
Default |
Description |
---|---|---|
none |
Specifies the type of event that triggers the management rule's action. Allowed values are as follows. The cluster, lifecycle, log, monitor, timer, and trace types are predefined events provided by the Enterprise Server. Note – Some topics in the documentation pertain to features that are available only in domains that are configured to support clusters. Examples of domains that support clusters are domains that are created with the cluster profile or the enterprise profile. For information about profiles, see Usage Profiles in Sun GlassFish Enterprise Server 2.1 Administration Guide.
For descriptions of required and optional properties corresponding to each of these types, see the following table. |
|
INFO |
(optional) Specifies the level at which to log the event occurrence. For information about log levels, see module-log-levels. Applicable only if record-event is set to true. |
|
true |
(optional) Specifies whether the occurrence of the event is logged. If no action is specified for the parent management-rule, the event is logged regardless of this setting. Note – Setting the type to log is different from setting record-event to true. The former specifies what the event is. The latter specifies what happens after the event occurs. |
The following table describes properties for the event element. Property names are case insensitive.
Table 1–58 event Properties
Event Type |
Property |
Values |
Description |
---|---|---|---|
cluster |
start, stop, fail |
Notifies when the GMS starts, stops, or reports failure of a server instance. |
|
cluster |
A comma-separated list of server instance names, or * for all server instances |
Specifies the server instances about which GMS notifications are given. |
|
lifecycle |
ready, shutdown, termination |
Specifies a server life cycle event. Values correspond to events defined in the com.sun.appserv.server.LifecycleEvent interface. |
|
log |
A comma-separated list of logger names, or * for all loggers, which is the default |
(optional) Notifies when the specified loggers write messages to the server log. For a list of logger names, see module-log-levels. |
|
log |
A comma-separated list of log levels |
(optional) Notifies when messages of the specified level are written to the server log. For information about log levels, see module-log-levels. |
|
monitor |
A name attribute of a user-defined mbean, or a JMX ObjectName for a system mbean |
Specifies the name of the monitored MBean. Either this property or observedObject must be specified. |
|
monitor |
An object-name attribute of a user-defined mbean, or a JMX ObjectName for a system mbean |
Specifies the name of the monitored MBean. Either this property or observedMbean must be specified. |
|
monitor |
An mbean Attribute name |
Specifies the monitored attribute of the monitored MBean. |
|
monitor |
CounterMonitor, GaugeMonitor, StringMonitor |
The type of monitoring of the attribute. |
|
monitor |
Time interval in seconds (long int) |
(optional) Specifies the granularity at which the monitoring data should be collected. |
|
monitor |
true or false |
Specifies that the attribute value must match the stringToCompare value. Either this property or notifyDiffer is required if the monitor type is StringMonitor. |
|
monitor |
true or false |
Specifies that the attribute value must not match the stringToCompare value. Either this property or notifyMatch is required if the monitor type is StringMonitor. |
|
monitor |
A String |
Specifies the value to which the attribute value is compared. Required if the monitor type is StringMonitor. |
|
monitor |
byte, double, float, int, long, short |
Specifies the type of the numeric value being monitored. Required if the monitor is of type CounterMonitor or GaugeMonitor. |
|
monitor |
true or false |
Specifies the difference mode flag value common to all observed MBeans. Required if the monitor is of type CounterMonitor or GaugeMonitor. |
|
monitor |
A positive number of the type specified by numberType |
Specifies a value above which notification occurs. Required if the monitor is of type CounterMonitor. |
|
monitor |
A positive number of the type specified by numberType |
(optional) Specifies that the event should be re-triggered when the initThreshold value plus this offset value is reached. Applicable if the monitor is of type CounterMonitor. |
|
monitor |
A positive number of the type specified by numberType |
(optional) Specifies the modulus value common to all observed MBeans. Applicable if the monitor is of type CounterMonitor. |
|
monitor |
A positive number of the type specified by numberType |
Specifies the upper limit of the range within which notification occurs. Required if the monitor is of type GaugeMonitor. |
|
monitor |
A positive number of the type specified by numberType |
Specifies the lower limit of the range within which notification occurs. Required if the monitor is of type GaugeMonitor. |
|
notification |
name of mbean |
Specifies a custom MBean that implements the JMX NotificationEmitter interface. Either this property or sourceObjectName must be specified. |
|
notification |
object-name of mbean |
Specifies a custom MBean that implements the JMX NotificationEmitter interface. Either this property or sourceMBean must be specified. |
|
notification |
The notification type |
(optional) Specifies the notification type. If this property is specified, the action of the parent management-rule is performed only if the notification type emitted is same as this property's value. |
|
timer |
Input format determined by pattern property |
Begins notification at the specified date and time. |
|
timer |
SimpleDateFormat pattern |
(optional) Specifies the date and time input format. The default is mm/dd/yyyy hh:mm:ss. |
|
timer |
Time interval in milliseconds (long int) |
(optional) Notification repeats at the specified time interval. |
|
timer |
A positive number (long int) |
(optional) Specifies the number of times notification occurs. |
|
timer |
A String |
(optional) Specifies a message that is delivered as part of timer notification. |
|
trace |
web_component_method_entry, web_component_method_exit, ejb_component_method_entry, ejb_component_method_exit, request_start, request_end |
Notifies at the specified trace point. |
|
trace |
An IP address |
Specifies the IP address for which trace notifications are sent. |
|
trace |
A String |
Specifies the caller principal for which trace notifications are sent. |
|
trace |
A String |
Specifies the component name for which trace notifications are sent. |