|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
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 |
public String getApplicationName() throws InstanceNotFoundException, JMException, com.bea.wlevs.management.ManagementException
public String getStageName() throws InstanceNotFoundException, JMException, com.bea.wlevs.management.ManagementException
public long getMetric() throws InstanceNotFoundException, JMException, com.bea.wlevs.management.ManagementException
StageMBean
public void restart() throws InstanceNotFoundException, JMException, com.bea.wlevs.management.ManagementException
public void stop() throws InstanceNotFoundException, JMException, com.bea.wlevs.management.ManagementException
public void terminate() throws InstanceNotFoundException, JMException, com.bea.wlevs.management.ManagementException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |