|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@Mixins(value=AlarmSystem.AlarmSystemMixin.class) public interface AlarmSystem
Defines the AlarmSystem interface.
The AlarmSystem
is a central registry/handler for all
Alarm
objects. By registering AlarmListener
s
to the AlarmSystem, objects are able to 'ignore' the fact that there
are many Alarm
objects in the system.
Also, new attributes registered with the AlarmSystem will propagate into
all existing and future Alarm
s, whereas attributes at
Alarm
level is individual to an Alarm
.
Many different AlarmModels can co-exist in the same application. In fact, every Alarm 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 );
}
Nested Class Summary | |
---|---|
static class |
AlarmSystem.AlarmSystemMixin
AlarmSystem implementation. |
Method Summary | |
---|---|
void |
addAlarmListener(AlarmListener listener)
Register AlarmListener to recieve AlarmEvents from all
Alarms managed by this AlarmSystem . |
Query<Alarm> |
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. |
Alarm |
createAlarm(String name,
AlarmCategory category)
Creates an Alarm with the default AlarmModel. |
AlarmModel |
defaultAlarmModel()
Returns the default AlarmModel. |
void |
removeAlarmListener(AlarmListener listener)
Remove the AlarmListener from the AlarmSystem . |
Method Detail |
---|
List<AlarmModelDescriptor> alarmModels()
AlarmModel defaultAlarmModel()
Query<Alarm> 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.
Alarm createAlarm(String name, AlarmCategory category)
name
- the name of the Alarm to be created.category
- The category the created Alarm 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()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |