public class AlarmSourceCentral extends Object implements Runnable, AlarmSourceCentralMBean
This class acts as a proxy where incoming alarms are dispatched or
forwarded to all registered AlarmSource
attached to it.
One AlarmSourceCentral
(and corresponding
AlarmSinkCentral
) is always present
in the NCS JVM and it is started when NCS JVM is started.
It is also possible to start AlarmSourceCentral
outside the NCS JVM.
Each client AlarmSource
that is attached to
a AlarmSourceCentral
gets its own queue to
check for incoming alarms.
The AlarmSourceCentral
maintains or handles
the client queues, for each incoming alarm to CDB
it creates a new instance of Alarm
and puts the
new instance into all the client queues that are attached to this
AlarmSourceCentral
.
Modifier and Type | Method and Description |
---|---|
void |
awaitRunning()
Deprecated.
|
static ArrayBlockingQueue<Alarm> |
getAlarmQueue()
Returns a new alarm queue.
|
static AlarmSourceCentral |
getAlarmSource(int alarmQueueLen,
Cdb cdb)
Retrieves the alarm source central object.
|
boolean |
isAlive() |
static void |
returnAlarmQueue(ArrayBlockingQueue<Alarm> queue)
Returns the queue.
|
void |
run() |
void |
start()
Start the AlarmSourceCentral which makes
it possible for AlarmSource's to attach to this
AlarmSourceCentral and receive notifications.
|
void |
stop() |
public boolean isAlive()
isAlive
in interface AlarmSourceCentralMBean
@Deprecated public void awaitRunning() throws InterruptedException
InterruptedException
public static AlarmSourceCentral getAlarmSource(int alarmQueueLen, Cdb cdb) throws IOException, NavuException, ConfException
alarmQueueLen
- the maximum queue length.cdb
- the CDB socket to subscribe over.IOException
NavuException
ConfException
public static ArrayBlockingQueue<Alarm> getAlarmQueue()
public static void returnAlarmQueue(ArrayBlockingQueue<Alarm> queue)
queue
- public void start()
start
in interface AlarmSourceCentralMBean
public void stop()
stop
in interface AlarmSourceCentralMBean