|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectqueued.sdk.java.examples.MultipleAlarm
Monitors queues and fires alarm when queues reach their interaction threshold.
This example uses process bars to display queue activity:
activity = (number of interactions in the queue)/(alarm threshold)*100
The alarm threshold is the number of interactions that you allow in the queue. You can set up a default threshold for all queues or specify a particular interaction threashold for each queue. The GUI sends an alarm if the number of interactions in this queue is greater than the threshold. When the queue contains exactly opr more interaction than the threshold, an alarm is fired:
This example uses the following Queued Interaction Java Application Blocks:
GetQueue
Application Block
Field Summary | |
javax.swing.JButton |
applyDefaultThresholdButton
|
javax.swing.JButton |
applyThresholdButton
|
javax.swing.JTextField |
defaultThresholdField
|
javax.swing.JComboBox |
queueComboBox
|
java.util.HashMap |
queueInfo
|
javax.swing.JTextField |
thresholdField
|
Constructor Summary | |
MultipleAlarm(java.lang.String windowTitle)
Constructor. |
Method Summary | |
int |
getActivity(java.lang.String queueName)
Returns the queue activity as a percentage. |
void |
handleQueueEvent(QILQueueEvent event)
Receives QILQueueEvent , which report changes in the monitored queue.
|
void |
itemStateChanged(java.awt.event.ItemEvent evt)
Implements the ItemListener method.
|
void |
linkWidgetsToGui()
Links QIL information to GUI components. |
static void |
main(java.lang.String[] args)
|
void |
setDefaultThreshold(java.lang.Integer defaultThreshold)
Sets up a default interaction threshold for all queues. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public java.util.HashMap queueInfo
public javax.swing.JTextField thresholdField
public javax.swing.JButton applyThresholdButton
public javax.swing.JComboBox queueComboBox
public javax.swing.JButton applyDefaultThresholdButton
public javax.swing.JTextField defaultThresholdField
Constructor Detail |
public MultipleAlarm(java.lang.String windowTitle)
Method Detail |
public void linkWidgetsToGui()
This method uses the GetQueue
Application Block to retrieve the list of queues to be monitored.
public void setDefaultThreshold(java.lang.Integer defaultThreshold)
This method modifies the threshold associated with queues, and updates the queues activity.
defaultThreshold
- public static void main(java.lang.String[] args)
public void handleQueueEvent(QILQueueEvent event)
QILQueueEvent
, which report changes in the monitored queue.
If you implement the QILQueueListener
interface, you must implement this method.
SimpleQueueAlarm
example uses this method to manage the queue alarm.
public void itemStateChanged(java.awt.event.ItemEvent evt)
ItemListener
method.
If the user selects a queue in the combox, this method updates the Queue Details
panel.
itemStateChanged
in interface java.awt.event.ItemListener
ItemListener.itemStateChanged(java.awt.event.ItemEvent)
public int getActivity(java.lang.String queueName)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |