@Mixins(value=AlarmSystem.AlarmSystemMixin.class) public interface AlarmSystem
The AlarmSystem
is a central registry/handler for all
AlarmPoint
objects. By registering AlarmListener
s
to the AlarmSystem, objects are able to 'ignore' the fact that there
are many AlarmPoint
objects in the system.
Also, new attributes registered with the AlarmSystem will propagate into
all existing and future AlarmPoint
s, whereas attributes at
AlarmPoint
level is individual to an AlarmPoint
.
Many different AlarmModels can co-exist in the same application. In fact, every AlarmPoint can have its own AlarmModel, and the AlarmModel can be changed in runtime, for unrivaled flexibility. However, typically the AlarmModel is set in the AlarmSystem only, and all Alarms will use the default model.
The default alarm model is a service set by during assembly;
public void assemble( ModuleAssembly module )
throws AssemblyException
{
module.addServices( AlarmSystemService.class );
module.addServices( StandardAlarmModelService.class );
}
Modifier and Type | Interface and Description |
---|---|
static class |
AlarmSystem.AlarmSystemMixin
AlarmSystem implementation.
|
Modifier and Type | Method and Description |
---|---|
void |
addAlarmListener(AlarmListener listener)
Register AlarmListener to recieve
AlarmEvents from all
Alarms managed by this AlarmSystem . |
Query<AlarmPoint> |
alarmList()
Returns a list of all Alarms registered to the service.
|
List<AlarmListener> |
alarmListeners()
Returns an immmutable list of all AlarmListeners registered to the service.
|
List<AlarmModelDescriptor> |
alarmModels()
Returns all the AlarmModels that has been installed.
|
AlarmPoint |
createAlarm(String name,
AlarmCategory category)
Creates an AlarmPoint with the default AlarmModel.
|
AlarmModel |
defaultAlarmModel()
Returns the default AlarmModel.
|
void |
removeAlarmListener(AlarmListener listener)
Remove the
AlarmListener from the AlarmSystem . |
List<AlarmModelDescriptor> alarmModels()
AlarmModel defaultAlarmModel()
Query<AlarmPoint> alarmList()
The returned Collection may not be modified in any way. The implementation is free to return a clone, but not required to do so, and may decide to terminate if the collection is modified.
AlarmPoint createAlarm(String name, AlarmCategory category)
name
- the name of the AlarmPoint to be created.category
- The category the created AlarmPoint should belong to.void addAlarmListener(AlarmListener listener)
AlarmEvents
from all
Alarms
managed by this AlarmSystem
.listener
- the global listener to be added.void removeAlarmListener(AlarmListener listener)
AlarmListener
from the AlarmSystem
.listener
- the global listener to be removed.List<AlarmListener> alarmListeners()