com.groiss.wfxml
Interface ResponseListener


public interface ResponseListener

ResponseListeners are designed to be used when a message cannot be sent immediately. This can happen in two cases:


So, in general, it is nearly always a good idea to use response listeners, because your application becomes more stable (independent of network and remote server failures), and it can run on both active or passive servers.
As soon as the target partner gets the message and returns its response, this response will be passed on to the ResponseListener's responseArrived method.
Mind: the responseArrived method will be called only one time. After the response arrived, no more messages will be given to the ResponseListener. If you want to receive other messages (like NotifyMessage or PIStateChangedMessage messages), you must add a ProcessInstanceObserver to your CreatePIMessage request when you create a new remote process instance.
So, if you want to define a ResponseListener, use the Sender.send(WfXMLMessage, Partner, Class, boolean) method for sending your message.


Method Summary
 void responseArrived(WfXMLMessage request, WfXMLMessage response)
          Implement this method if you want to create a ResponseListener.
 

Method Detail

responseArrived

void responseArrived(WfXMLMessage request,
                     WfXMLMessage response)
Implement this method if you want to create a ResponseListener.

Parameters:
request - This is the request message that was sent to the partner. You get it here as parameter again, so that you can get keys, parameters or whatever out of it. That may be necessary in order to find out which request message that was exactly.
response - A WfXMLMessage object holding the response message for which you were waiting. Use the various getter methods of the message in order to access the content of the message.


Copyright © 2001-2006 Groiss Informatics GmbH. All Rights Reserved.