Sun GlassFish Enterprise Server 2.1 Administration Reference

event

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.


Note –

If multiple rules are associated with the same event, ordering of action execution is not guaranteed.


Superelements

management-rule

Subelements

The following table describes subelements for the event element.

Table 1–56 event Subelements

Element 

Required 

Description 

description

zero or one 

Contains a text description of this element. 

property

zero or more 

Specifies a property or a variable. 

Attributes

The following table describes attributes for the event element.

Table 1–57 event Attributes

Attribute 

Default 

Description 

type

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.


  • cluster — A Group Management Service (GMS) event. For more information, see group-management-service.

  • lifecycle — A lifecycle event. For more information about the server life cycle, see the Sun GlassFish Enterprise Server 2.1 Developer’s Guide.

  • log — An event in the server log. For more information about the server log, see log-service.

  • monitor — A monitoring event, which is a change in the attribute of a monitored mbean.

  • notification — A JMX notification event. Any custom mbean that implements the JMX NotificationEmitter interface can be a notification event.

  • timer — An event that occurs at a specified time.

  • trace — A trace event.

For descriptions of required and optional properties corresponding to each of these types, see the following table. 

level

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.

record-event

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.


Properties

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

name

start, stop, fail

Notifies when the GMS starts, stops, or reports failure of a server instance. 

cluster

serverName

A comma-separated list of server instance names, or * for all server instances

Specifies the server instances about which GMS notifications are given. 

lifecycle

name

ready, shutdown, termination

Specifies a server life cycle event. Values correspond to events defined in the com.sun.appserv.server.LifecycleEvent interface.

log

loggerNames

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

level

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

observedMbean

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

observedObject

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

observedAttribute

An mbean Attribute name

Specifies the monitored attribute of the monitored MBean. 

monitor

monitorType

CounterMonitor, GaugeMonitor, StringMonitor

The type of monitoring of the attribute. 

monitor

granularityPeriod

Time interval in seconds (long int)

(optional) Specifies the granularity at which the monitoring data should be collected. 

monitor

notifyMatch

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

notifyDiffer

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

stringToCompare

A String

Specifies the value to which the attribute value is compared. Required if the monitor type is StringMonitor.

monitor

numberType

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

differenceMode

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

initThreshold

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

offset

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

modulus

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

highThreshold

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

lowThreshold

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

sourceMBean

name of mbean

Specifies a custom MBean that implements the JMX NotificationEmitter interface. Either this property or sourceObjectName must be specified.

notification

sourceObjectName

object-name of mbean

Specifies a custom MBean that implements the JMX NotificationEmitter interface. Either this property or sourceMBean must be specified.

notification

type

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

dateString

Input format determined by pattern property

Begins notification at the specified date and time. 

timer

pattern

SimpleDateFormat pattern

(optional) Specifies the date and time input format. The default is mm/dd/yyyy hh:mm:ss.

timer

period

Time interval in milliseconds (long int)

(optional) Notification repeats at the specified time interval. 

timer

numberOfOccurrences

A positive number (long int)

(optional) Specifies the number of times notification occurs. 

timer

message

A String

(optional) Specifies a message that is delivered as part of timer notification. 

trace

name

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

ipAddress

An IP address 

Specifies the IP address for which trace notifications are sent. 

trace

callerPrincipal

A String

Specifies the caller principal for which trace notifications are sent. 

trace

componentName

A String

Specifies the component name for which trace notifications are sent.