com.ibm.workflow.upes
Class UPES

java.lang.Object
  |
  +--com.ibm.workflow.upes.UPES
All Implemented Interfaces:
java.lang.Runnable

public class UPES
extends java.lang.Object
implements java.lang.Runnable

The UPES class represents an user defined program execution server. This means that it reads messages from a specified input queue and supports (registered) UPESListeners with the recieved message.

An UPES listens to one input queue which must be specified with queue name and queue manager name. It is able to send messages to an arbitrary queue also specified by queue and queue manager name.

UPESListener can register or deregister to the UPES so that when a message arrives the UPES asks each listener if it is responsible to handle the message. It then gives the message to the first listener which claims the responsibility.

This is just a sample implementation of java UPES. This listener concept is just one possible implementation.


Field Summary
private  java.lang.String _InputQMgrName
          _InputQMgrName name of the queue manager to which the UPES listens.
private  java.lang.String _InputQName
          _InputQName name of the queue to which the UPES listens.
private  java.util.Hashtable _Listeners
          _Listeners contain all registered UPESListeners
 java.lang.String _log
           
private static int _threadCount
           
protected  java.util.Vector aChangeListener
           
 
Constructor Summary
UPES(java.lang.String QName, java.lang.String QMgrName)
          UPES constructor which sets the queue name and queue manager name to which the UPES has to listen for incoming messages.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener newListener)
          Add a javax.swing.event.ChangeListener.
 void DeRegisterUPESListener(UPESListener u)
          With DeRegisterUPESListener a already registered UPESListener can be deregistered.
protected  void fireStateChanged(javax.swing.event.ChangeEvent e)
          Method to support listener events.
 java.lang.String get_log()
          Insert the method's description here.
 java.lang.String getInputQMgrName()
           
 java.lang.String getInputQName()
           
static int getThreadID()
           
static void helpMessage()
           
 void ProcessIncommingXMLMessage(MQHandler MQH, java.lang.String msg, java.lang.String responseQ, java.lang.String responseQMgr)
           
 void RegisterUPESListener(UPESListener u)
          With RegisterUPESListener an UPESListener can be registered.
 void removeChangeListener(javax.swing.event.ChangeListener newListener)
          Remove a javax.swing.event.ChangeListener.
 void run()
          run is the actual polling and processing loop for the UPES.
 void SendMessage(MQHandler MQH, InvokeProgramResponseData response, java.lang.String QueueManagerName, java.lang.String QName)
          With SendMessage the caller can send a invoke program response message to an arbitrary queue.
 void set_log(java.lang.String new_log)
          Insert the method's description here.
 void setInputQMgrName(java.lang.String s)
           
 void setInputQName(java.lang.String s)
           
 void WaitForMessages(int numberOfThreads)
          WaitForMessages opens a thread, which processes incoming messages
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

_Listeners

private java.util.Hashtable _Listeners
_Listeners contain all registered UPESListeners
See Also:
Hashtable, UPESListener

_InputQName

private java.lang.String _InputQName
_InputQName name of the queue to which the UPES listens.

_InputQMgrName

private java.lang.String _InputQMgrName
_InputQMgrName name of the queue manager to which the UPES listens.

_log

public java.lang.String _log

aChangeListener

protected transient java.util.Vector aChangeListener

_threadCount

private static int _threadCount
Constructor Detail

UPES

public UPES(java.lang.String QName,
            java.lang.String QMgrName)
     throws com.ibm.mq.MQException
UPES constructor which sets the queue name and queue manager name to which the UPES has to listen for incoming messages.
Method Detail

getThreadID

public static int getThreadID()

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener newListener)
Add a javax.swing.event.ChangeListener.

DeRegisterUPESListener

public void DeRegisterUPESListener(UPESListener u)
With DeRegisterUPESListener a already registered UPESListener can be deregistered.

fireStateChanged

protected void fireStateChanged(javax.swing.event.ChangeEvent e)
Method to support listener events.

get_log

public java.lang.String get_log()
Insert the method's description here. Creation date: (14.07.00 19:35:43)
Returns:
java.lang.String

getInputQMgrName

public java.lang.String getInputQMgrName()

getInputQName

public java.lang.String getInputQName()

helpMessage

public static void helpMessage()
Returns:
 

ProcessIncommingXMLMessage

public void ProcessIncommingXMLMessage(MQHandler MQH,
                                       java.lang.String msg,
                                       java.lang.String responseQ,
                                       java.lang.String responseQMgr)
Returns:
 

RegisterUPESListener

public void RegisterUPESListener(UPESListener u)
With RegisterUPESListener an UPESListener can be registered.

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener newListener)
Remove a javax.swing.event.ChangeListener.

run

public void run()
run is the actual polling and processing loop for the UPES. It first gets an XML message from the input queue and then calls 'ProcessIncommingXMLMessage' to process the message.
Specified by:
run in interface java.lang.Runnable

SendMessage

public void SendMessage(MQHandler MQH,
                        InvokeProgramResponseData response,
                        java.lang.String QueueManagerName,
                        java.lang.String QName)
With SendMessage the caller can send a invoke program response message to an arbitrary queue.

set_log

public void set_log(java.lang.String new_log)
Insert the method's description here. Creation date: (14.07.00 19:35:43)
Parameters:
new_log - java.lang.String

setInputQMgrName

public void setInputQMgrName(java.lang.String s)

setInputQName

public void setInputQName(java.lang.String s)

WaitForMessages

public void WaitForMessages(int numberOfThreads)
WaitForMessages opens a thread, which processes incoming messages