org.ow2.jasmine.interfaces.jmx.alarms
Class JMXAlarmManager

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.ow2.jasmine.interfaces.jmx.alarms.JMXAlarmManager
All Implemented Interfaces:
NotificationBroadcaster, NotificationEmitter, JMXAlarmManagerMBean

public class JMXAlarmManager
extends NotificationBroadcasterSupport
implements JMXAlarmManagerMBean

Implementation of the MBean dedicated to alarms.

This MBean supplies methods to retrieve alarm information by giving their id.
It's also able to send notifications when an alarm is raised.

This class must only be manipulated via its unique instance.

Author:
Awa OUEDRAOGO, Laurent RUAUD

Method Summary
 CompositeData getAlarm(int id)
          Retrieves information on the specified alarm from the log interface.
 TabularData getAlarmRange(int lowid, int highid)
          Retrieves the alarms with an id contained in the specified range of id inclusive.
static JMXAlarmManager getInstance()
          Gets the only instance available.
 TabularData getLastAlarms(int nb)
          Retrieves information on the last raised alarms from the log interface.
static ObjectName getObjectName()
          Gets the object name matching the unique instance.
 void notifyAlarm(int id)
          Sends a notification to the MBean server.
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static JMXAlarmManager getInstance()
Gets the only instance available.

Returns:
the unique instance.

getObjectName

public static ObjectName getObjectName()
Gets the object name matching the unique instance.

Returns:
the unique object name.

notifyAlarm

public void notifyAlarm(int id)
Sends a notification to the MBean server.

Parameters:
id - id of the alarm to be notified.

getAlarm

public CompositeData getAlarm(int id)
Retrieves information on the specified alarm from the log interface.

Specified by:
getAlarm in interface JMXAlarmManagerMBean
Parameters:
id - id of the alarm.
Returns:
a composite object containing a copy of alarm's information.

getLastAlarms

public TabularData getLastAlarms(int nb)
Retrieves information on the last raised alarms from the log interface. The maximum number of alarm to retrieve must be specified.

Specified by:
getLastAlarms in interface JMXAlarmManagerMBean
Parameters:
nb - number of alarms to retrieve.
Returns:
a tabular object containing copies of alarm's information.

getAlarmRange

public TabularData getAlarmRange(int lowid,
                                 int highid)
Retrieves the alarms with an id contained in the specified range of id inclusive.

Specified by:
getAlarmRange in interface JMXAlarmManagerMBean
Parameters:
lowid - the low threshold.
highid - the high threshold.
Returns:
a tabular object containing copies of alarm's information.


Copyright © 2013 OW2 Consortium. All Rights Reserved.