Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.wlevs.management.runtime
Interface StageMonitoringMetricRuntimeMBean

public interface StageMonitoringMetricRuntimeMBean
extends RuntimeMBean

StageMonitoringMetricRuntimeMBean is created to monitor different types of metrics for various stage components of an Event Processing Network. Each of these is created/registered/unregistered dynamically in the Platform MBeanServer. The naming of this MBean is derived from the hierarchy and the parameters that were passed to create the RuntimeMBean. For example assuming that this RuntimeMBean was created to monitor the average throughput of an EPL based processor by calling `StageMBean.createMonitoringMetricAvgThroughput(long, long)` with the following parameters

- throughput interval - 10 SECONDS
- average interval - 10 SECONDS

The `ObjectName` of this RuntimeMBean will be com.bea.wlevs:Name=MetricAvgThroughput.10.10.SECONDS, Type=StageMonitoringMetricRuntime,EPLProcessor=myprocessor,Application=myapplication The following code assumes this RuntimeMBean was created to monitor the average throughput of a the default processor(which is a stage endpoint). The default processor is the one that ships with the Weblogic Event Server.

      ObjectName metricMBeanName =
                 ObjectName.getInstance("com.bea.wlevs:Name=MetricAvgThroughput.10.10.SECONDS,
                              Type=StageMonitoringMetricRuntime,EPLProcessor=myprocessor,Application=myapplication");

       StageMonitoringMetricRuntimeMBean mb = (StageMonitoringMetricRuntimeMBean)
                   MBeanServerInvocationHandler.newProxyInstance(
                                    mbsc,
                                    metricMBeanName,
                                    StageMonitoringMetricRuntimeMBean.class,
                                    true);

     //call the metric method. This method could be called in a loop to get continous update
     long metricValue = mb.getMetric();

      //Alternatively create a JMX notification listener. This listener will be called whenever the
      //monitoring metric is updated in the MBean.
      EventNotificationListener listener = new EventNotificationListener();

        mbsc.addNotificationListener(mb,listener,null,null);

      //other stuff
           .
           .
           .

     //Notification listener class

      public class EventNotificationListener implements NotificationListener {

            public void handleNotification(Notification notification, Object handback) {

                System.out.println("\t\t Notification recieved " + notification.toString());
            }
        }

Method Summary
`String` | `getApplicationName()` This method returns the name of the application.
`long` | `getMetric()` This method returns the value of the monitoring metric.
`String` | `getStageName()` This method returns the name of the stage.
`void` | `restart()` This method resets the monitoring metric value.
`void` | `stop()` This method stops collection of any more monitoring metrics
`void` | `terminate()` This method terminates metric collection and unregisters this MBean from the MBeanServer.

Methods inherited from interface com.bea.wlevs.management.runtime.RuntimeMBean
`preDeregister`

Methods inherited from interface com.bea.wlevs.management.WebLogicMBean
`getMBeanInfo, getName, getObjectName, getType, isRegistered`

Method Detail

### getApplicationName

    public String getApplicationName()
                              throws InstanceNotFoundException,
                                     JMException,
                                     com.bea.wlevs.management.ManagementException

  This method returns the name of the application.

  Returns:
    String - name of the Appliction
  Throws:
    InstanceNotFoundException -
    JMException -
    com.bea.wlevs.management.ManagementException -

### getStageName

    public String getStageName()
                        throws InstanceNotFoundException,
                               JMException,
                               com.bea.wlevs.management.ManagementException

  This method returns the name of the stage.

  Returns:
    String - name of the Stage
  Throws:
    InstanceNotFoundException -
    JMException -
    com.bea.wlevs.management.ManagementException -

### getMetric

    public long getMetric()
                   throws InstanceNotFoundException,
                          JMException,
                          com.bea.wlevs.management.ManagementException

  This method returns the value of the monitoring metric. The possible metrics whose values are reported are AvgThroughput,MaxLatency,AvgLatency, AvgLatencyThreshold. These metrics can be created from `StageMBean`

  Returns:
    long - value of the monitoring metric
  Throws:
    InstanceNotFoundException -
    JMException -
    com.bea.wlevs.management.ManagementException -

### restart

    public void restart()
                 throws InstanceNotFoundException,
                        JMException,
                        com.bea.wlevs.management.ManagementException

  This method resets the monitoring metric value.

  Throws:
    InstanceNotFoundException -
    JMException -
    com.bea.wlevs.management.ManagementException -

### stop

    public void stop()
              throws InstanceNotFoundException,
                     JMException,
                     com.bea.wlevs.management.ManagementException

  This method stops collection of any more monitoring metrics

  Throws:
    InstanceNotFoundException -
    JMException -
    com.bea.wlevs.management.ManagementException -

### terminate

    public void terminate()
                   throws InstanceNotFoundException,
                          JMException,
                          com.bea.wlevs.management.ManagementException

  This method terminates metric collection and unregisters this MBean from the MBeanServer.

  Throws:
    InstanceNotFoundException -
    JMException -
    com.bea.wlevs.management.ManagementException -

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD