FileDocCategorySizeDatePackage
MonitoringEvent.javaAPI DocGlassfish v2 API5794Fri May 04 22:33:34 BST 2007com.sun.enterprise.admin.event

MonitoringEvent

public class MonitoringEvent extends com.sun.enterprise.admin.event.AdminEvent
Monitoring Event. A monitoring event should trigger start, stop or collection of monitoring data for specified component.

Fields Summary
public static final String
START_MONITORING
Constant denoting action of monitoring start
public static final String
STOP_MONITORING
Constant denoting action of monitoring stop
public static final String
GET_MONITOR_DATA
Constant denoting action of get monitoring data (collection of data)
public static final String
LIST_MONITORABLE
Constant denoting action of list monitorable components
public static final String
SET_MONITOR_DATA
Constant denoting action of set (for TxnMgr admin currently)
static final String
eventType
Event type
private String
componentName
private String
actionCode
private Object
command
Constructors Summary
public MonitoringEvent(String instance, String component, String action)
Create a new MonitoringEvent.

param
instance name of the server instance to which this event applies
param
component name of the server component to which this event applies
param
action monitoring action, one of MonitoringEvent.START_MONITORING, MonitoringEvent.STOP_MONITORING, MonitoringEvent.GET_MONITOR_DATA, MonitoringEvent.LIST_MONITORABLE


                                                             
           
        this(instance, component, action, null);
    
public MonitoringEvent(String instance, String component, String action, Object command)
Create a new MonitoringEvent.

param
instance name of the server instance to which this event applies
param
component name of the server component to which this event applies
param
action monitoring action, one of MonitoringEvent.START_MONITORING, MonitoringEvent.STOP_MONITORING, MonitoringEvent.GET_MONITOR_DATA, MonitoringEvent.LIST_MONITORABLE
param
command a monitoring command. Command is extra information that is used in monitoring event listeners. This is typically an instance of com.sun.enterprise.admin.monitor.MonitorCommand (or its sub-class) and may be null.

        super(eventType, instance);
        componentName = component;
        actionCode = action;
        this.command = command;
    
Methods Summary
public java.lang.StringgetActionCode()
Get event action code - one of MonitoringEvent.START_MONITORING, MonitoringEvent.STOP_MONITORING, MonitoringEvent.GET_MONITOR_DATA, MonitoringEvent.LIST_MONITORABLE

        return actionCode;
    
public java.lang.ObjectgetCommand()
Get monitoring command information. This is used to access an instance of com.sun.enterprise.admin.monitor.MonitorCommand (or its sub classes) from the event. This may be null.

return
Monitoring command

        return command;
    
public java.lang.StringgetComponentName()
Get name of component to which this event applies.

        return componentName;
    
public java.lang.StringtoString()
Get a string representation.

        return "MonitoringEvent -- " + componentName + " -- " + actionCode;