Package com.tailf.ncs.alarmman.consumer
Class AlarmSourceCentral
Object
com.tailf.ncs.alarmman.consumer.AlarmSourceCentral
- All Implemented Interfaces:
- AlarmSourceCentralMBean,- Runnable
The consuming part of the Alarm API.
 
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.
- 
Method SummaryModifier and TypeMethodDescriptionvoidDeprecated.static ArrayBlockingQueue<Alarm>Returns a new alarm queue.static AlarmSourceCentralgetAlarmSource(int alarmQueueLen, Cdb cdb) Retrieves the alarm source central object.booleanisAlive()static voidreturnAlarmQueue(ArrayBlockingQueue<Alarm> queue) Returns the queue.voidrun()voidstart()Start the AlarmSourceCentral which makes it possible for AlarmSource's to attach to thisAlarmSourceCentraland receive notifications.voidstop()
- 
Method Details- 
isAlivepublic boolean isAlive()- Specified by:
- isAlivein interface- AlarmSourceCentralMBean
 
- 
awaitRunningDeprecated.- Throws:
- InterruptedException
 
- 
getAlarmSourcepublic static AlarmSourceCentral getAlarmSource(int alarmQueueLen, Cdb cdb) throws IOException, NavuException, ConfException Retrieves the alarm source central object.- Parameters:
- alarmQueueLen- the maximum queue length.
- cdb- the CDB socket to subscribe over.
- Returns:
- the alarm source
- Throws:
- IOException
- NavuException
- ConfException
 
- 
getAlarmQueueReturns a new alarm queue.- Returns:
- ArrayBlockingQueue<Alarm>
 
- 
returnAlarmQueueReturns the queue.- Parameters:
- queue-
 
- 
startpublic void start()Start the AlarmSourceCentral which makes it possible for AlarmSource's to attach to thisAlarmSourceCentraland receive notifications.- Specified by:
- startin interface- AlarmSourceCentralMBean
 
- 
stoppublic void stop()- Specified by:
- stopin interface- AlarmSourceCentralMBean
 
- 
runpublic void run()
 
-