org.smartcomps.twister.engine.priv.messaging
Class MessageBroker

java.lang.Object
  |
  +--org.smartcomps.twister.engine.priv.messaging.MessageBroker
Direct Known Subclasses:
DefaultMessageBrokerImpl

public abstract class MessageBroker
extends java.lang.Object

Creates and sends messages as ordered by the engine core. This class is abstract and therefore must be subclassed to do anything interesting. By subclassing it you'll be able to receive those messages and forward them to your own services in a relevent way for your own business. To make this class call your services you will have to provide your own implementation, put it in the classpath and change the twister.messagebroker.impl property in the twister-implementation.properties file.


Field Summary
static java.lang.String WORKLIST_OP
           
static java.lang.String WORKLIST_PT
           
 
Constructor Summary
MessageBroker()
           
 
Method Summary
 void asyncInvoke(java.lang.String partner, java.lang.String portType, java.lang.String operation, org.dom4j.Document message)
          Sends asynchronously a message to the specified (operation, portType, partner).
protected abstract  void asyncSend(java.lang.String partner, java.lang.String portType, java.lang.String operation, org.dom4j.Document message)
          Implement this method in your subclass to receive messages from the process engine and execute your own tasks accordingly.
 org.dom4j.Document syncInvoke(java.lang.String partner, java.lang.String portType, java.lang.String operation, org.dom4j.Document message)
          Syncronously send a message to the specified (operation, portType, partner).
protected abstract  org.dom4j.Document syncSend(java.lang.String partner, java.lang.String portType, java.lang.String operation, org.dom4j.Document message)
          Implement this method in your subclass to receive messages from the process engine and execute your own tasks accordingly.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WORKLIST_PT

public static final java.lang.String WORKLIST_PT
See Also:
Constant Field Values

WORKLIST_OP

public static final java.lang.String WORKLIST_OP
See Also:
Constant Field Values
Constructor Detail

MessageBroker

public MessageBroker()
Method Detail

asyncInvoke

public final void asyncInvoke(java.lang.String partner,
                              java.lang.String portType,
                              java.lang.String operation,
                              org.dom4j.Document message)
Sends asynchronously a message to the specified (operation, portType, partner). As it's asynchronous, no response are expected. Keep in mind that the provided message can be null if we're simply invoking a service with no input parameter. Check if the message is not targeted at the WorkList Manager. If it is, creates a new WorkItem, if it isn't, just forward the call to asyncCall.

Parameters:
partner -
portType -
operation -
message -

syncInvoke

public final org.dom4j.Document syncInvoke(java.lang.String partner,
                                           java.lang.String portType,
                                           java.lang.String operation,
                                           org.dom4j.Document message)
Syncronously send a message to the specified (operation, portType, partner). A response is expected in return.

Parameters:
partner -
portType -
operation -
message -
Returns:

asyncSend

protected abstract void asyncSend(java.lang.String partner,
                                  java.lang.String portType,
                                  java.lang.String operation,
                                  org.dom4j.Document message)
Implement this method in your subclass to receive messages from the process engine and execute your own tasks accordingly. Keep in mind that the provided message can be null if we're simply invoking a service with no input parameter.

Parameters:
partner -
portType -
operation -
message -

syncSend

protected abstract org.dom4j.Document syncSend(java.lang.String partner,
                                               java.lang.String portType,
                                               java.lang.String operation,
                                               org.dom4j.Document message)
Implement this method in your subclass to receive messages from the process engine and execute your own tasks accordingly. Keep in mind that the provided message can be null if we're simply invoking a service with no input parameter.

Parameters:
partner -
portType -
operation -
message -
Returns:


Copyright © 2003 SmartComps. All Rights Reserved.