|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softwareag.entirex.aci.BrokerCommunication com.softwareag.entirex.aci.Conversation
public class Conversation
Represents a conversational communication with a participant.
When a new instance of a Conversation object is created, the first
send or sendReceive call will establish a new conversation. The caller
plays the role of a client in this conversation.
When a new instance of a Conversation object is created, the first
receive call will wait for a new conversation established by a client.
The caller plays the role of a server in this conversation.
An instance of a Conversation object is automatically created when a new
conversation is received from the receive call of a BrokerService object.
BrokerService.receive(java.lang.String)
Field Summary |
---|
Fields inherited from class com.softwareag.entirex.aci.BrokerCommunication |
---|
brokerService |
Constructor Summary | |
---|---|
Conversation(BrokerService brokerService)
Creates a new Conversation object and attaches it to the specified BrokerService. |
|
Conversation(BrokerService brokerService,
ConversationState cstate)
Creates a new Conversation object and attaches it to the specified BrokerService. |
Method Summary | |
---|---|
void |
cancel()
Cancels the current conversation. |
void |
end()
Ends the current conversation. |
void |
ignoreEOC(boolean sendEOC)
Per default the call to receive and receivePreview methods will return null for the 0003 0005 error (Partner finished the conversation) only. |
BrokerMessage |
receive()
Receives an incoming request and waits for an answer. |
BrokerMessage |
receive(java.lang.String wait)
Receives an incoming request and waits the specified time for an answer. |
BrokerMessage |
receiveLast()
Re-reads the last message that was received for this conversation. |
BrokerMessage |
receivePreview()
Receives an incoming request in preview mode and waits the default time for an answer. |
BrokerMessage |
receivePreview(java.lang.String wait)
Receives an incoming request in preview mode and waits the specified time for an answer. |
void |
send(BrokerMessage msg)
Sends an asynchronous conversational message. |
BrokerMessage |
sendReceive(BrokerMessage msg)
Sends a synchronous conversational message. |
BrokerMessage |
sendReceive(BrokerMessage msg,
java.lang.String wait)
Sends a synchronous conversational message. |
Methods inherited from class com.softwareag.entirex.aci.BrokerCommunication |
---|
dispose, getBrokerService, getUserData, saveState, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Conversation(BrokerService brokerService)
brokerService
- an instance of a BrokerService object.public Conversation(BrokerService brokerService, ConversationState cstate) throws java.lang.IllegalArgumentException
brokerService
- an instance of a BrokerService object.cstate
- the ConversationState object to be restored.
java.lang.IllegalArgumentException
- if ConversationState object is null.ConversationState
Method Detail |
---|
public void ignoreEOC(boolean sendEOC)
sendEOC
- if true send automatically an EOC to Broker for this conversationpublic void send(BrokerMessage msg) throws BrokerException
msg
- BrokerMessage to send.
BrokerException
- A Broker exception.public BrokerMessage sendReceive(BrokerMessage msg, java.lang.String wait) throws BrokerException
msg
- BrokerMessage to send.wait
- A timeout period, how long to wait for
an immediate reply, measured in seconds/minutes/hours
(depending on the trailing S/M/H character).
BrokerException
- A Broker exception.
java.lang.IllegalArgumentException
- if parameter is invalid.public BrokerMessage sendReceive(BrokerMessage msg) throws BrokerException
msg
- the message to send.
BrokerException
- A Broker exception.
java.lang.IllegalArgumentException
- if parameter is invalid.public void end() throws BrokerException
Conversation
object for the next conversation
after calling this method.
BrokerException
- A Broker exception.public void cancel() throws BrokerException
Conversation
object for the next conversation
after calling this method.
BrokerException
- A Broker exception.public BrokerMessage receive(java.lang.String wait) throws BrokerException
wait
- A timeout period, how long to wait for
a receive, measured in seconds/minutes/hours
(depending on the trailing S/M/H character).
When null or "NO" is specified, the operation is non-blocked.
If no message is available, a Broker Exception with
errorclass=74 and errorcode=74 is thrown.
BrokerException
- A Broker exception.
java.lang.IllegalArgumentException
- Thrown if parameter is invalid.public BrokerMessage receive() throws BrokerException
BrokerException
- A Broker exception.public BrokerMessage receiveLast() throws BrokerException
BrokerException
- A Broker exception.public BrokerMessage receivePreview(java.lang.String wait) throws BrokerException
wait
- A timeout period, how long to wait for
a receive, measured in seconds/minutes/hours
(depending on the trailing S/M/H character).
When null or "NO" is specified, the operation is non-blocked.
If no message is available, a Broker Exception with
errorclass=74 and errorcode=74 is thrown.
null
if the conversation
has been ended normally.
BrokerException
- A Broker exception.
java.lang.IllegalArgumentException
- Thrown if parameter is invalid.public BrokerMessage receivePreview() throws BrokerException
null
is returned.
Uses the maximum receive length.
BrokerException
- A Broker exception.
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |