net.esper.indicator.jmx
Class JMXLastEventIndicator

java.lang.Object
  extended by net.esper.indicator.jmx.JMXLastEventIndicator
All Implemented Interfaces:
UpdateListener

public final class JMXLastEventIndicator
extends Object
implements UpdateListener

This listeners can be used to indicate events received through a JMX console. The class utilizes DynamicMBean beans. In presents the last event only, and does not expose the notion of a history. There are 2 implementations for the DynamicMBean interface that the class chooses from, depending on the event type: one for events that don't contain an OLAP cube JMXLastElementDynamicMBean and one for cubes JMXLastCubeElementDynamicMBean. MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); ObjectName name = new ObjectName(domainName + ":" + keyProperties + ",indexProperty=" + indexProperty); mbs.registerMBean(this, name);


Constructor Summary
JMXLastEventIndicator(EventType eventType, String domainName, String keyProperties)
          Constructor.
 
Method Summary
 void update(EventBean[] newData, EventBean[] oldData)
          Notify that new events are available or old events are removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMXLastEventIndicator

public JMXLastEventIndicator(EventType eventType,
                             String domainName,
                             String keyProperties)
Constructor.

Parameters:
eventType - type of event to indicate
domainName - is the domain name to use to constract a JMX ObjectName for the MBean.
keyProperties - is the properties to use to constract a JMX ObjectName for the MBean
Method Detail

update

public final void update(EventBean[] newData,
                         EventBean[] oldData)
Description copied from interface: UpdateListener
Notify that new events are available or old events are removed. If the call to update contains new (inserted) events, then the first argument will be a non-empty list and the second will be empty. Similarly, if the call is a notification of deleted events, then the first argument will be empty and the second will be non-empty. Either the newEvents or oldEvents will be non-null. This method won't be called with both arguments being null, but either one could be null. The same is true for zero-length arrays. Either newEvents or oldEvents will be non-empty. If both are non-empty, then the update is a modification notification.

Specified by:
update in interface UpdateListener
Parameters:
newData - is any new events. This will be null or empty if the update is for old events only.
oldData - is any old events. This will be null or empty if the update is for new events only.

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com