com.softwareag.entirex.aci
Class BrokerCommunication

java.lang.Object
  extended by com.softwareag.entirex.aci.BrokerCommunication
Direct Known Subclasses:
Conversation, UnitofWork

public abstract class BrokerCommunication
extends java.lang.Object

Abstract superclass for conversational communication and UnitofWork communication.
Defines methods which are used by both Conversation and UnitofWork objects.

See Also:
Conversation, UnitofWork

Field Summary
protected  BrokerService brokerService
          The BrokerService object to which the Communication belongs.
 
Method Summary
 void dispose()
          Deprecated. This method does nothing, since no reference to the Conversation or UnitofWork object is held anymore.
 BrokerService getBrokerService()
          Returns the BrokerService object to which the communication belongs.
 byte[] getUserData()
          Returns the user data associated with this communication.
 ConversationState saveState()
          Returns a ConversationState object for the current Conversation object or the current UnitofWork object.
 void setUserData(byte[] u)
          Sets the user data associated with this communication.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

brokerService

protected BrokerService brokerService
The BrokerService object to which the Communication belongs. Should only be used in the direct subclasses.

Method Detail

getBrokerService

public BrokerService getBrokerService()
Returns the BrokerService object to which the communication belongs.

Returns:
reference to BrokerService object.

getUserData

public byte[] getUserData()
Returns the user data associated with this communication. User data can be up to 16 bytes and can contain any type of binary data. The user data is totally untouched by EntireX Broker. It is never transmitted from one application to another (i.e., from a client to a server). Both sides of a conversation can store different user data, and both sides always receive their own data.
The user data is transmitted on a send() method and returned with the message to the receiving application. User data can be overwritten with each send() call.

Returns:
user data as byte array or null.

setUserData

public void setUserData(byte[] u)
Sets the user data associated with this communication. User data can be up to 16 bytes.
Note: This method updates only the UserData property of this object.

Parameters:
u - user data as byte array
Throws:
java.lang.IllegalArgumentException - Thrown if the length of the user data exceeds 16 bytes.
See Also:
getUserData()

saveState

public ConversationState saveState()
                            throws java.lang.IllegalArgumentException
Returns a ConversationState object for the current Conversation object or the current UnitofWork object. This object can be used to restore the Conversation object or UnitofWork object in a separate Java process.

Returns:
the ConversationState object.
Throws:
java.lang.IllegalArgumentException - if conversation ID is invalid.
Since:
7.1.1.10
See Also:
ConversationState

dispose

public void dispose()
             throws BrokerException
Deprecated. This method does nothing, since no reference to the Conversation or UnitofWork object is held anymore.

Call this method to release the Conversation or UnitofWork object in case you do not call end() or cancel(). dispose() does not call the Broker.

Throws:
BrokerException - A Broker exception.
Since:
5.2.1.2