public boolean clearAlarm(String alarmID) throws NullPointerException, FacilityException { if (alarmID == null) { throw new NullPointerException("AllarmID must not be null."); } if(!this.mBean.isAlarmAlive(alarmID)) return false; if (!this.mBean.isSourceOwnerOfAlarm(getNotificationSource(), alarmID)) { throw new FacilityException("Source: " + getNotificationSource() + ", is not owner of alarm with id: " + alarmID); } try { return this.mBean.clearAlarm(alarmID); } catch (Exception e) { throw new FacilityException("Failed to clear alarm: " + alarmID + ", for source: " + getNotificationSource(), e); } }
public void createAlarm(ComponentID alarmSource, Level alarmLevel, java.lang.String alarmType, java.lang.String message, java.lang.Throwable cause, long timestamp, boolean allowCauseNull) throws NullPointerException, IllegalArgumentException, UnrecognizedComponentException, FacilityException { if (alarmSource == null) { throw new NullPointerException("AlarmSource must not be null"); } if (alarmLevel == null) { throw new NullPointerException("AlarmLevel must not be null"); } if (alarmType == null) { throw new NullPointerException("AlarmType must not be null"); } if (message == null) { throw new NullPointerException("Message must not be null"); } if (!allowCauseNull && cause == null) { throw new NullPointerException("Cause must nto be null"); } if (!this.mBean.isRegisteredAlarmComponent(alarmSource)) { throw new UnrecognizedComponentException("Declared alarm source is not valid compoenent. Either it is nto able to create alarms or has been uninstalled"); } try { this.mBean.createAlarm(alarmSource, alarmLevel, alarmType, message, cause, timestamp); } catch (Exception e) { } }
/** * return the ObjectName of the AlarmMBean * * @see javax.slee.management.SleeManagementMBean#getAlarmMBean() */ public ObjectName getAlarmMBean() { return sleeContainer.getAlarmManagement().getAlarmMBeanObjectName(); }
@Override public void sleeInitialization() { alarmFacility = sleeContainer.getAlarmManagement().newAlarmFacility(new CongestionControlNotification(sleeContainer.getCluster(CacheType.ACTIVITIES).getLocalAddress())); }
public int clearAlarms(String alarmType) throws NullPointerException, FacilityException { if (alarmType == null) { throw new NullPointerException("AlarmType must not be null."); } try { return this.mBean.clearAlarms(getNotificationSource().getNotificationSource(), alarmType); } catch (Exception e) { throw new FacilityException("Failed to clear alarms for source: " + getNotificationSource(), e); } }
public String raiseAlarm(java.lang.String alarmType, java.lang.String instanceID, AlarmLevel level, String message, Throwable cause) throws NullPointerException, IllegalArgumentException, FacilityException { if (alarmType == null) { throw new NullPointerException("AlarmType must not be null"); } if (instanceID == null) { throw new NullPointerException("InstanceID must not be null"); } if (level == null) { throw new NullPointerException("AlarmLevel must not be null"); } if (message == null) { throw new NullPointerException("Message must not be null"); } if (level.isClear()) { throw new IllegalArgumentException("Raised alarm must not have level equal to AlarmLevel.CLEAR"); } try { //if (this.mBean.isAlarmAlive(getNotificationSource(), alarmType, instanceID)) { // return this.mBean.getAlarmId(getNotificationSource(), alarmType, instanceID); //} else { return this.mBean.raiseAlarm(getNotificationSource(), alarmType, instanceID, level, message, cause); //} } catch (Exception e) { throw new FacilityException("Failed to raise alarm for source: " + getNotificationSource(), e); } }
sleeContainer.getAlarmManagement().registerComponent( sbbComponent.getSbbID());
this.notificationSource = notificationSource; this.usageMbean = usageMbean; this.alarmFacility = sleeContainer.getAlarmManagement().newAlarmFacility(notificationSource);
public int clearAlarms() throws FacilityException { try { return this.mBean.clearAlarms(getNotificationSource().getNotificationSource()); } catch (Exception e) { throw new FacilityException("Failed to clear alarms for source: " + getNotificationSource(), e); } }