public interface AlarmFacility
AlarmMBean
. If a request is
made to clear an alarm and the identified alarm is currently raised, the alarm
is cleared and a corresponding alarm notification is generated by the
AlarmMBean
. Requests to raise an alarm that is
already raised or to clear an alarm that is not currently raised cause no
further action in the SLEE, ie. notifications are not generated in this case.
Each AlarmFacility
object is associated with a particular
NotificationSource
, an object that identifies the SLEE
component or subsystem that the alarm facility belongs to. For example, the
AlarmFacility
object that a particular SBB obtains from its JNDI environment
is associated with a notification source that identifies the SBB that that JNDI
environment was created for and the service that that SBB belongs to.
Each occurrence of an alarm is uniquely identified by an alarm identifier generated by the SLEE. Each alarm identifier is associated to an alarm with three identifying attributes:
NotificationSource
object associated to the AlarmFacility
where the alarm was raised. This attribute is implicitly provided by the
alarm facility when the alarm is raised.
All operations invoked on the AlarmFacility
interface only apply
to alarms belonging to the notification source associated with the AlarmFacility
object.
The Alarm Facility is non-transactional. The effects of operations invoked on this facility occur immediately regardless of the state or outcome of any enclosing transaction.
An SBB or profile object obtains access to an AlarmFacility
object via
its JNDI environment. The Alarm Facility is bound into JNDI using the name specified
by JNDI_NAME
. A resource adaptor entity obtains access to an
AlarmFacility
object via the ResourceAdaptorContext
.
AlarmMBean
,
AlarmNotification
Modifier and Type | Field and Description |
---|---|
static String |
JNDI_NAME
Constant declaring the JNDI name where an
AlarmFacility object
is bound into an SBB, profile object's, or resource adaptor object's JNDI
environment. |
Modifier and Type | Method and Description |
---|---|
boolean |
clearAlarm(String alarmID)
Request that the alarm with the specified alarm identifier be cleared.
|
int |
clearAlarms()
Request that all alarms belonging to the notification source associated with
the
AlarmFacility object be cleared. |
int |
clearAlarms(String alarmType)
Request that all alarms of the specified type be cleared.
|
void |
createAlarm(ComponentID alarmSource,
Level alarmLevel,
String alarmType,
String message,
long timestamp)
Deprecated.
This method uses a
ComponentID to identify a notification
source and thus is not compatible with the changes made to the alarm subsystem
in SLEE 1.1. In addition the levels provided by the Level class were
not practical for stateful alarm use. This method has been replaced with
raiseAlarm(String,String,AlarmLevel,String) . |
void |
createAlarm(ComponentID alarmSource,
Level alarmLevel,
String alarmType,
String message,
Throwable cause,
long timestamp)
Deprecated.
This method uses a
ComponentID to identify a notification
source and thus is not compatible with the changes made to the alarm subsystem
in SLEE 1.1. In addition the levels provided by the Level class were
not practical for stateful alarm use. This method has been replaced with
raiseAlarm(String,String,AlarmLevel,String,Throwable) . |
String |
raiseAlarm(String alarmType,
String instanceID,
AlarmLevel alarmLevel,
String message)
Request that an alarm be raised with the specified message if an alarm with
the same identifying attributes is not currently active.
|
String |
raiseAlarm(String alarmType,
String instanceID,
AlarmLevel alarmLevel,
String message,
Throwable cause)
Request that an alarm be raised with the specified message and cause throwable
if an alarm with the same identifying attributes is not currently active.
|
static final String JNDI_NAME
AlarmFacility
object
is bound into an SBB, profile object's, or resource adaptor object's JNDI
environment.
The value of this constant is "java:comp/env/slee/facilities/alarm".
void createAlarm(ComponentID alarmSource, Level alarmLevel, String alarmType, String message, long timestamp) throws NullPointerException, IllegalArgumentException, UnrecognizedComponentException, FacilityException
ComponentID
to identify a notification
source and thus is not compatible with the changes made to the alarm subsystem
in SLEE 1.1. In addition the levels provided by the Level
class were
not practical for stateful alarm use. This method has been replaced with
raiseAlarm(String,String,AlarmLevel,String)
.This method is a non-transactional method.
alarmSource
- the identifier of the component that is emitting the alarm.alarmLevel
- the level of the alarm.alarmType
- a string denoting the type of the alarm. Refer to the
SLEE specification for recommended formatting of alarm type strings.message
- the alarm message.timestamp
- the time (in ms since January 1, 1970 UTC) that the alarm was generated.NullPointerException
- if any parameter is null
.IllegalArgumentException
- if alarmLevel ==
Level.OFF
.UnrecognizedComponentException
- if alarmSource
is not a recognizable
ComponentID
object for the SLEE or it does not correspond
with a component installed in the SLEE.FacilityException
- if the alarm could not be generated due to a system-level failure.void createAlarm(ComponentID alarmSource, Level alarmLevel, String alarmType, String message, Throwable cause, long timestamp) throws NullPointerException, IllegalArgumentException, UnrecognizedComponentException, FacilityException
ComponentID
to identify a notification
source and thus is not compatible with the changes made to the alarm subsystem
in SLEE 1.1. In addition the levels provided by the Level
class were
not practical for stateful alarm use. This method has been replaced with
raiseAlarm(String,String,AlarmLevel,String,Throwable)
.This method is a non-transactional method.
alarmSource
- the identifier of the component that is emitting the alarm.alarmLevel
- the level of the alarm.alarmType
- a string denoting the type of the alarm. Refer to the
SLEE specification for recommended formatting of alarm type strings.message
- the alarm message.cause
- the reason (if any) this alarm was generated.timestamp
- the time (in ms since January 1, 1970 UTC) that the alarm was generated.NullPointerException
- if any parameter is null
.IllegalArgumentException
- if alarmLevel ==
Level.OFF
.UnrecognizedComponentException
- if alarmSource
is not a recognizable
ComponentID
object for the SLEE or it does not correspond
with a component installed in the SLEE.FacilityException
- if the alarm could not be generated due to a system-level failure.String raiseAlarm(String alarmType, String instanceID, AlarmLevel alarmLevel, String message) throws NullPointerException, IllegalArgumentException, FacilityException
clearAlarm
methods in this interface, or by a management client
interacting with an AlarmMBean
object.
If an alarm with the same identifying attributes (notification source, alarm
type, and instance ID) is already active in the SLEE, this method has no
effect and the alarm identifier of the existing active alarm is returned.
If no such alarm exists, the alarm is raised, the SLEE's AlarmMBean
object emits an AlarmNotification
, and a
SLEE-generated alarm identifier for the new alarm is returned.
This method is equivalent to:
This method is a non-transactional method.
alarmType
- an identifier specifying the type of the alarm.instanceID
- an identifier specifying the particular instance of the
alarm type that is occurring.alarmLevel
- the level of the alarm. The level cannot be AlarmLevel.CLEAR
.message
- the message to include in the alarm if the alarm is raised
as a result of this method call.NullPointerException
- if any argument is null
.IllegalArgumentException
- if alarmLevel
is AlarmLevel.CLEAR
.FacilityException
- if the alarm could not be raised due to a system-level failure.String raiseAlarm(String alarmType, String instanceID, AlarmLevel alarmLevel, String message, Throwable cause) throws NullPointerException, IllegalArgumentException, FacilityException
clearAlarm
methods in this interface, or by a management client
interacting with an AlarmMBean
object.
If an alarm with the same identifying attributes (notification source, alarm
type, and instance ID) is already active in the SLEE, this method has no
effect and the alarm identifier of the existing active alarm is returned.
If no such alarm exists, the alarm is raised, the SLEE's AlarmMBean
object emits an AlarmNotification
, and a
SLEE-generated alarm identifier for the new alarm is returned.
This method is a non-transactional method.
alarmType
- an identifier specifying the type of the alarm.instanceID
- an identifier specifying the particular instance of the
alarm type that is occurring.alarmLevel
- the level of the alarm. The level cannot be AlarmLevel.CLEAR
.message
- the message to include in the alarm if the alarm is raised
as a result of this method call.cause
- an optional Throwable
object that caused this alarm
to be raised, included in the alarm descriptor if the alarm is raised
as a result of this method call.NullPointerException
- if alarmType
, instanceID
,
alarmLevel
, or message
is null
.IllegalArgumentException
- if alarmLevel
is AlarmLevel.CLEAR
.FacilityException
- if the alarm could not be raised due to a system-level failure.boolean clearAlarm(String alarmID) throws NullPointerException, FacilityException
This method only affects alarms belonging to the notification source associated
with the AlarmFacility
object. If the specified alarm is cleared,
the SLEE's AlarmMBean
object emits an AlarmNotification
for the alarm with the alarm level in the notification set to AlarmLevel.CLEAR
.
This method is a non-transactional method.
alarmID
- the unique alarm identifier for the alarm.true
if the specified alarm existed and was cleared as a
result of this method, false
otherwise.NullPointerException
- if alarmID
is null
.FacilityException
- if the alarm could not be cleared due to a system-level
failure.int clearAlarms(String alarmType) throws NullPointerException, FacilityException
This method only affects alarms belonging to the notification source associated
with the AlarmFacility
object. If one or more alarms are cleared
by this method, the SLEE's AlarmMBean
object emits an
AlarmNotification
for each alarm with the alarm
level in each notification set to AlarmLevel.CLEAR
.
This method is a non-transactional method.
alarmType
- the type of the alarms to clear.NullPointerException
- if alarmType
is null
.FacilityException
- if the alarms could not be cleared due to a system-level
failure.int clearAlarms() throws FacilityException
AlarmFacility
object be cleared.
This method only affects alarms belonging to the notification source associated
with the AlarmFacility
object instance. If one or more alarms are
cleared by this method, the SLEE's AlarmMBean
object emits an
AlarmNotification
for each alarm with the alarm
level in each notification set to AlarmLevel.CLEAR
.
This method is a non-transactional method.
FacilityException
- if the alarms could not be cleared due to a system-level
failure.