queued.sdk.java.examples
Class MultipleAlarm

java.lang.Object
  extended byqueued.sdk.java.examples.MultipleAlarm
All Implemented Interfaces:
java.util.EventListener, java.awt.event.ItemListener

public class MultipleAlarm
extends java.lang.Object
implements java.awt.event.ItemListener

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:


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

queueInfo

public java.util.HashMap queueInfo

thresholdField

public javax.swing.JTextField thresholdField

applyThresholdButton

public javax.swing.JButton applyThresholdButton

queueComboBox

public javax.swing.JComboBox queueComboBox

applyDefaultThresholdButton

public javax.swing.JButton applyDefaultThresholdButton

defaultThresholdField

public javax.swing.JTextField defaultThresholdField
Constructor Detail

MultipleAlarm

public MultipleAlarm(java.lang.String windowTitle)
Constructor. Connects to Configuration Server and Interaction Server.

Method Detail

linkWidgetsToGui

public void linkWidgetsToGui()
Links QIL information to GUI components.

This method uses the GetQueue Application Block to retrieve the list of queues to be monitored.


setDefaultThreshold

public void setDefaultThreshold(java.lang.Integer defaultThreshold)
Sets up a default interaction threshold for all queues.

This method modifies the threshold associated with queues, and updates the queues activity.

Parameters:
defaultThreshold -

main

public static void main(java.lang.String[] args)

handleQueueEvent

public void handleQueueEvent(QILQueueEvent event)
Receives QILQueueEvent, which report changes in the monitored queue. If you implement the QILQueueListener interface, you must implement this method.
The SimpleQueueAlarm example uses this method to manage the queue alarm.


itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent evt)
Implements the ItemListener method.

If the user selects a queue in the combox, this method updates the Queue Details panel.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener
See Also:
ItemListener.itemStateChanged(java.awt.event.ItemEvent)

getActivity

public int getActivity(java.lang.String queueName)
Returns the queue activity as a percentage.