com.ibm.vap.ccfadapter.ims
Class IMSRequester
java.lang.Object
|
+--com.ibm.vap.generic.Requester
|
+--com.ibm.vap.ccfadapter.CCFRequester
|
+--com.ibm.vap.ccfadapter.ims.IMSRequester
- public class IMSRequester
- extends CCFRequester
Requester dedicated to IMSAdapter using CCF/IMS Connect library
Method Summary |
IMSAdapter |
getIMSAdapter()
|
int |
receive(char[] message,
int offset,
int length)
Waits for a response associated to the last request. |
int |
receiveCheck()
Checks for a response associated to the last request, without waiting. |
void |
release()
Releases the requester. |
int |
send(char[] message,
int offset,
int length)
Sends a message to the server. |
Methods inherited from class com.ibm.vap.generic.Requester |
getMessageId,
getProperty,
setMessageId,
setProperty |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
TRANSACTION_NAME_SIZE
public static final int TRANSACTION_NAME_SIZE
getIMSAdapter
public IMSAdapter getIMSAdapter()
receive
public int receive(char[] message,
int offset,
int length)
throws com.ibm.vap.generic.CommunicationError
- Description copied from class: CCFRequester
- Waits for a response associated to the last request.
This function must wait until at least one character has been received from the
VisualAge Pacbase communication monitor at the server side.
The received characters must be stored in the given char array, starting at the given offset and
stopping when either "length" characters have been copied or no more character is available for
reception.
The function must return the total number of characters currently received.
When this method returns the value "nbReturn", two cases can be considered :
- "nbReturn <= length" : only "nbReturn" characters have been currently received and are stored in the
char array. A subsequent call to "receive" will likely block.
- "nbReturn > length" : more than "length" characters have been received, but only the first "length"
have been stored in the char array. Subsequent calls to "receive" will not block until at least all the
remaining characters (nbReturn-length) have been returned.
Calling "receive" with a length of 0 is a good way to wait for characters without getting any of them (thus,
without having to allocate a char array). Then "receive" can be called a second time to get all the currently
received characters (passing the value returned by the first call as "length" parameter).
Since this method must wait until characters are received, it should never return 0.
The only case where the returned value can be 0 is when a receive timeout has expired.
- Overrides:
- receive in class CCFRequester
- Tags copied from class: CCFRequester
- Throws:
- com.ibm.vap.generic.CommunicationError - is thrown if an error condition is encountered.
receiveCheck
public int receiveCheck()
throws com.ibm.vap.generic.CommunicationError
- Description copied from class: CCFRequester
- Checks for a response associated to the last request, without waiting.
The method returns the number of characters currently received.
When this method returns 0, it means that a subsequent call to "receive" will likely block.
Else, it means that a subsequent call to receive will not block.
- Overrides:
- receiveCheck in class CCFRequester
release
public void release()
- Description copied from class: CCFRequester
- Releases the requester.
Once released, the methods of the requester have an unpredictable result and thus should not be called.
- Overrides:
- release in class CCFRequester
send
public int send(char[] message,
int offset,
int length)
throws com.ibm.vap.generic.CommunicationError
- Sends a message to the server.
The given message must be passed to the Visualage Pacbase communication monitor at the server side.
- Overrides:
- send in class CCFRequester
- Parameters:
message
- to be sent to the serveroffset
- defines the starting charactere where to start sending the messagelength
- of the message to be sent- Returns:
- the number of bytes effectively sent
- Throws:
- com.ibm.vap.generic.CommunicationError - if the execute method fails
Licensed Materials - Property of IBM - 5655-F37 - (C) Copyright IBM Corp. 1983, 2003. All Rights Reserved.
IBM, VisualAge and Pacbase are trademarks of International Business Machines Corporation registered in the United States, other countries, or both.
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States,other countries, or both.
Other company, product or service names may be the trademarks or service marks of others.