com.ibm.workflow.upes
Interface UPESListener


public interface UPESListener

The UPESListener is an interface which should be implemented by applications containing the actual UPES functionality. Classes implementing this interface can register with an UPES. The UPES uses the given interfaces for identifying for an incoming XML message which listener is responsible for this message. The first listener which is active (detected by the IsActive() method) and claims the responsibility for the message (detected by the IsResponsibleFor(InvokeProgramData msg) method) will be triggered with a ProcessMessage(UPES u,InvokeProgramData msg) method call. This sample implements only an interface to handle InvokeProgram requests (this is interface provided by MQSeries Workflow version 3.2.1 and higher)

See Also:
UPES

Method Summary
 java.lang.String getName()
          Just a name to distinguish different listeners
 boolean IsActive()
          The method IsActive signals the caller whether the listener is ready to accept messages or not.
 boolean IsResponsibleFor(InvokeProgramData msg)
          The method IsResponsible signals the caller whether the listener is responsible for a given message or not.
 void ProcessMessage(UPES u, MQHandler MQH, InvokeProgramData msg)
          ProcessMessage will be called when the listener has claimed the responsibility for a message.
 

Method Detail

getName

public java.lang.String getName()
Just a name to distinguish different listeners
Returns:
the name of the UPESListener

IsActive

public boolean IsActive()
The method IsActive signals the caller whether the listener is ready to accept messages or not.
Returns:
true, if the UPESListener is idle and ready to process messages by the ProcessMessage method.
false,if the UPESListener is either busy or not ready to process messages.

IsResponsibleFor

public boolean IsResponsibleFor(InvokeProgramData msg)
The method IsResponsible signals the caller whether the listener is responsible for a given message or not. Responsibility means that the listener is able to process the message.
Parameters:
msg - contains all information, which was sent with the XML request.
Returns:
true, if the listener claims the responsibility for the incoming message.
false, otherwise
See Also:
InvokeProgramData, UPES

ProcessMessage

public void ProcessMessage(UPES u,
                           MQHandler MQH,
                           InvokeProgramData msg)
ProcessMessage will be called when the listener has claimed the responsibility for a message.
Parameters:
u - is a reference to the UPES which called the listener for processing the message. It can be used to put a response within the same transaction to a target queue.
MQH - is the MQHandler, with which the reguest was gotten.
msg - is the request.
See Also:
UPES, InvokeProgramData, MQHandler