com.groiss.wfxml
Class MessageListenerAdapter

java.lang.Object
  extended by com.groiss.wfxml.MessageListenerAdapter
All Implemented Interfaces:
MessageListener

public class MessageListenerAdapter
extends java.lang.Object
implements MessageListener

This is a default implementation of the MessageListener interface. Extend it and overwrite some methods, if you want to have a listener that handles only some message types.
For a detailed description of these methods and the general purpose of a message listener, read the comments in the MessageListener interface.


Constructor Summary
MessageListenerAdapter()
           
 
Method Summary
 void after(ChangePIStateMessage request, ProcessInstance pi, WfXMLMessage response)
          Default implementation, does nothing.
 void after(CreatePIMessage request, ProcessInstance pi, WfXMLMessage response)
          Default implementation, does nothing.
 void after(GetPIDataMessage request, ProcessInstance pi, WfXMLMessage response)
          Default implementation, does nothing.
 boolean before(ChangePIStateMessage request)
          Default implementation, does nothing and returns true.
 boolean before(CreatePIMessage request)
          Default implementation, does nothing and returns true.
 boolean before(GetPIDataMessage request)
          Default implementation, does nothing and returns true.
 boolean before(NotifyMessage request)
          Default implementation, does nothing and returns true.
 boolean before(PIStateChangedMessage request)
          Default implementation, does nothing and returns true.
 WfXMLMessage handle(GenericMessage request)
          Default implementation, does nothing and returns null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageListenerAdapter

public MessageListenerAdapter()
Method Detail

handle

public WfXMLMessage handle(GenericMessage request)
Default implementation, does nothing and returns null.

Specified by:
handle in interface MessageListener
Parameters:
request - The incoming request message.
Returns:
You should generate a return message (in most cases this will also be a GenericMessage). If you don't want to send a response, simply return null.

before

public boolean before(CreatePIMessage request)
Default implementation, does nothing and returns true.

Specified by:
before in interface MessageListener
Parameters:
request - The incoming CreateProcessInstance request.
Returns:
true if you want that the WfXML layer processes the message or false if the message should not be processed.

before

public boolean before(GetPIDataMessage request)
Default implementation, does nothing and returns true.

Specified by:
before in interface MessageListener
Parameters:
request - The incoming GetProcessInstanceData request.
Returns:
true if you want that the WfXML layer processes the message or false if the message should not be processed.

before

public boolean before(ChangePIStateMessage request)
Default implementation, does nothing and returns true.

Specified by:
before in interface MessageListener
Parameters:
request - The incoming ChangeProcessInstanceState request.
Returns:
true if you want that the WfXML layer processes the message or false if the message should not be processed.

before

public boolean before(PIStateChangedMessage request)
Default implementation, does nothing and returns true.

Specified by:
before in interface MessageListener
Parameters:
request - The incoming ProcessInstanceStateChanged request.
Returns:
true if you want that the WfXML layer passes the message on to registered ProcessInstanceObservers or false if the message should not be given to observers.

before

public boolean before(NotifyMessage request)
Default implementation, does nothing and returns true.

Specified by:
before in interface MessageListener
Parameters:
request - The incoming Notify request.
Returns:
true if you want that the WfXML layer passes the message on to registered ProcessInstanceObservers or false if the message should not be given to observers.

after

public void after(CreatePIMessage request,
                  ProcessInstance pi,
                  WfXMLMessage response)
Default implementation, does nothing.

Specified by:
after in interface MessageListener
Parameters:
request - The request that has been processed.
pi - The new process instance.
response - The response message that will be sent back to the requester, or null if no response will be sent. The response will be most likely of type CreatePIMessage.

after

public void after(GetPIDataMessage request,
                  ProcessInstance pi,
                  WfXMLMessage response)
Default implementation, does nothing.

Specified by:
after in interface MessageListener
Parameters:
request - The request message that has been processed.
pi - The process instance of which data has been requested.
response - The response message that will be sent back to the requester. Here the response message should always be available, because a GetProcessInstanceData request requests data and so the response returns the requested data. The response will be of type GetPIDataMessage in most cases.

after

public void after(ChangePIStateMessage request,
                  ProcessInstance pi,
                  WfXMLMessage response)
Default implementation, does nothing.

Specified by:
after in interface MessageListener
Parameters:
request - The request message that has been processed.
pi - The affected process instance.
response - The response message that will be sent back to the requester. For this message type the response contains the new process instance state, so a response should always exist. The response message will be most likely of type ChangePIStateMessage.


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