|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.ims.application.IMSMessageQueue
IMSMessageQueue
provides services to send and receive
messages to an IMS message queue or to the application's Scratch
Pad Area (SPA). The SPA is used in conversational transactions to store
information between one step of the conversation and the next.
IMSMessageQueue
also supports sending messages to
another application if an alternate PCB for that application
is specified on the IMSMessageQueue
constructor.
In a non-conversational transaction, it is possible to code the
application with a message loop that retrieves messages until
IMS indicates that no more messages exist on the queue. To
support this style of programming, IMSMessageQueue.getUniqueMessage
returns true if a message could be returned from the queue and false
if it could not. The application is required to call
IMSTransaction.commit
prior to receiving the
second full message.
The following code snippet demonstrates this style of programming:
// Read the first segment of the input message
while(messageQueue.getUniqueMessage(inputMessage1)) {
// Read the second segment of the input message
messageQueue.getNextMessage(inputMessage2);
// Add logic here
// Insert reply back to the message queue
messageQueue.insertMessage(outputMessage);
// Commit the transaction.
trans.commit();
} // end while
IMSFieldMessage
,
DLIBaseSegment
,
DLITypeInfo
,
IMSTransaction
Constructor Summary | |
IMSMessageQueue()
Creates a new IMSMessageQueue which sends and receives messages to and from a terminal. |
|
IMSMessageQueue(java.lang.String alternatePCBName)
Creates a new IMSMessageQueue with the alternate PCB Name to send messages to a different terminal or application program. |
Method Summary | |
AIB |
getAIB()
Returns the Application Interface Block (AIB) used by the message queue. |
boolean |
getNextMessage(IMSFieldMessage message)
Receives the next segment of the message from IMS. |
boolean |
getUniqueMessage(IMSFieldMessage message)
Receives the first segment of an input message from IMS. |
void |
insertMessage(IMSFieldMessage message)
Send an output message to IMS. |
void |
insertMessage(IMSFieldMessage message,
boolean isLast)
Send the SPA to IMS and end the conversation if isLast is true. |
void |
insertMessage(IMSFieldMessage message,
java.lang.String modName)
Send an output message to IMS, specifying the Message Output Descriptor to format the output message. |
void |
insertMessage(IMSFieldMessage message,
java.lang.String modName,
boolean isLast)
Send the SPA to IMS with the Message Output Descriptor specified and end the conversation if isLast is true. |
void |
setModifiableAlternatePCB(java.lang.String destination)
Sets the destination in the modifiable alternate PCB. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IMSMessageQueue()
public IMSMessageQueue(java.lang.String alternatePCBName)
alternatePCBName
- - the alternate PCB Name where the message is sent.Method Detail |
public final AIB getAIB()
public boolean getNextMessage(IMSFieldMessage message) throws IMSException
message
- - the IMSFieldMessage
object to receive the messageIMSException
- if a non-blank status code is returned from the GN callpublic boolean getUniqueMessage(IMSFieldMessage message) throws IMSException
IMSException
- if a non-blank status code is returned from the GU call
or if getUniqueMessage
is called without commiting the previous changes.public void insertMessage(IMSFieldMessage message) throws IMSException
message
- - the message to sendIMSException
- if a non-blank status code is returned from the ISRT callpublic void insertMessage(IMSFieldMessage message, java.lang.String modName) throws IMSException
message
- - the message to sendmodName
- - the Message Output Descriptor (MOD) for formatting the output messageIMSException
- if a non-blank status code is returned from the ISRT callpublic void insertMessage(IMSFieldMessage message, java.lang.String modName, boolean isLast) throws IMSException
isLast
is true. This method is used in
convesational programs only.message
- - the message to sendmodName
- - the Message Output Descriptor (MOD) for formattingisLast
- - flag indicating whether this is the last segment for the conversationIMSException
- if a non-blank status code is returned from the ISRT callpublic void insertMessage(IMSFieldMessage message, boolean isLast) throws IMSException
isLast
is true.
This method should be used in convesational programs only.message
- - the message to sendisLast
- - flag indicating whether this is the last segment for the conversationIMSException
- if a non-blank status code is returned from the ISRT callpublic void setModifiableAlternatePCB(java.lang.String destination) throws IMSException
destination
- - transaction or logical terminal to send message to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |