|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.mqe.adapters.MQeCommunicationsAdapter | +--examples.adapters.MQeTcpipLengthGUIAdapter
The MQeTcpipLengthGUIAdapter is a simple example of how to create a communications adapter to be used with MQe. There is no rigorous error checking, neither does the adapter correctly deal with the situation where the data length to be written is greater than the length of buffer to use.
Field Summary | |
static short[] |
version
|
Constructor Summary | |
MQeTcpipLengthGUIAdapter()
|
Method Summary | |
void |
activate(MQePropertyProvider info)
Used to activate an adapter and should only ever be called once in the life-time of the object. |
void |
close()
Closes an adapter. |
void |
open()
Opens an adapter for use. |
byte[] |
read()
Reads data from the adapter. |
protected void |
setSocket(java.net.Socket newSocket)
|
void |
temporaryClose()
Closes a non persistent adapter. |
MQeCommunicationsAdapter |
waitForContact(MQePropertyProvider info)
Used by the listening adapter to wait for incoming data. |
void |
writeData(byte[] data)
Writes a request to the adapter stream. |
void |
writeResponse(byte[] data)
Writes response information to the adapter stream. |
Methods inherited from class com.ibm.mqe.adapters.MQeCommunicationsAdapter |
createNewAdapter, isStopDemanded, isStopRequested |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static short[] version
Constructor Detail |
public MQeTcpipLengthGUIAdapter()
Method Detail |
public void activate(MQePropertyProvider info) throws java.lang.Exception
MQeCommunicationsAdapter
Used to activate an adapter and should only ever be called once in the life-time of the object.
Note : This entry point is meant to be used by the WebSphere MQ Everyplace object library not by application programs.
activate
in class MQeCommunicationsAdapter
java.lang.Exception
- a Java lang exception if an error is encounteredMQeCommunicationsAdapter.activate(MQePropertyProvider)
public void close() throws java.lang.Exception
MQeCommunicationsAdapter
Closes an adapter. Implementations of this method should ensure that all network and system objects are correctly closed.
Note: This entry point is meant to be used by the WebSphere MQ Everyplace object library not by application programs.
close
in class MQeCommunicationsAdapter
java.lang.Exception
MQeCommunicationsAdapter.close()
public void open() throws java.lang.Exception
MQeCommunicationsAdapter
Opens an adapter for use. Implementations of this method need to take into account this method may be called more than once in the life-time of the adapter.
Note : This entry point is meant to be used by the WebSphere MQ Everyplace object library not by application programs.
open
in class MQeCommunicationsAdapter
java.lang.Exception
MQeCommunicationsAdapter.open()
public byte[] read() throws java.lang.Exception
MQeCommunicationsAdapter
Reads data from the adapter. The caller will expect a byte array of data to be returned. Any adapter specific information that has been flowed across with network with the data must be removed prior to returning the byte array.
Note : This entry point is meant to be used by the WebSphere MQ Everyplace object library not by application programs.
read
in class MQeCommunicationsAdapter
java.lang.Exception
- Error ocurred whilst reading from the networkMQeCommunicationsAdapter.read()
public void temporaryClose() throws java.lang.Exception
MQeCommunicationsAdapter
Closes a non persistent adapter. Implementors should only close the network and system objects if the variable persistentAdapter is false.
Note: This entry point is meant to be used by the WebSphere MQ Everyplace object library not by application programs.
At various times in the communications conversation it is desireable to close an adapter's communications resources, but only if it has not been explicitly stated they should remain open.
temporaryClose
in class MQeCommunicationsAdapter
java.lang.Exception
MQeCommunicationsAdapter.temporaryClose()
public MQeCommunicationsAdapter waitForContact(MQePropertyProvider info) throws java.lang.Exception
MQeCommunicationsAdapter
Used by the listening adapter to wait for incoming data.
On the responder side of a communciations conversation this method is responsible for waiting on a named socket for incoming requests. The method should return an instance of the given adapter to conduct the rest of the conversation whilst leaving the listening adapter free to wait for more requests. Implemenations of this method should use MQeCommunicationsAdapter.createNewAdapter to create the new adapter
waitForContact
in class MQeCommunicationsAdapter
java.lang.Exception
MQeCommunicationsAdapter.waitForContact(MQePropertyProvider)
public void writeData(byte[] data) throws java.lang.Exception
MQeCommunicationsAdapter
Writes a request to the adapter stream.
This method is used to write data to the network.
Note : This entry point is meant to be used by the WebSphere MQ Everyplace object library not by application programs.
writeData
in class MQeCommunicationsAdapter
data
- Byte array containing the data to be written.
java.lang.Exception
- Error ocurred whilst writing to the networkMQeCommunicationsAdapter.writeData(byte[])
public void writeResponse(byte[] data) throws java.lang.Exception
MQeCommunicationsAdapter
Writes response information to the adapter stream. Some protocols require specifc header information to be written with the data dependent upon the nature of the data. This method may be used if such a protocol is being used, otherwise, it is suggested that implementors call the writeData(byte[]) method from this method.
This method is used to write data to the network.
Note : This entry point is meant to be used by the WebSphere MQ Everyplace object library not by application programs.
writeResponse
in class MQeCommunicationsAdapter
data
- Byte array containing the data to be written.
java.lang.Exception
- Error ocurred whilst writing to the network.MQeCommunicationsAdapter.writeResponse(byte[])
protected void setSocket(java.net.Socket newSocket) throws java.lang.Exception
java.lang.Exception
|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |