|
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 | +--com.ibm.mqe.adapters.MQeTcpipAdapter
The MQeTcpipAdapter is an adapter that provides support for reading and writing data over TCP/IP streams.
This adapter cannot be used to connect two WebSphere MQ Everyplace applications, as it does not provide a protocol for the exchange of data. Various adapters that inherit from this class provide some possible protocols.
An instance of this class can be used to either listen for incoming TCP/IP connections, or connect to an existing listener. It is not possible for a single MQeTcpipAdapter object to do both.
MQeTcpipLengthAdapter
,
MQeTcpipHttpAdapter
,
MQeTcpipHistoryAdapter
Field Summary |
Constructor Summary | |
MQeTcpipAdapter()
|
Method Summary | |
void |
activate(MQePropertyProvider info)
Initialises a new MQeTcpipAdapter object. |
void |
close()
Closes the current MQeTcpipAdapter object. |
void |
open()
Opens a socket for use. |
byte[] |
readLength(int recordSize)
Reads bytes from the underlying TCP/IP stream. |
java.lang.String |
readln()
Reads a line of data from the underlying TCP/IP stream. |
void |
temporaryClose()
If the adapter is not persistent calls the close method |
MQeCommunicationsAdapter |
waitForContact(MQePropertyProvider info)
Only valid for a listening adapter, the adapter waits on a named socket for an incoming connection request. |
Methods inherited from class com.ibm.mqe.adapters.MQeCommunicationsAdapter |
createNewAdapter, isStopDemanded, isStopRequested, read, writeData, writeResponse |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MQeTcpipAdapter()
Method Detail |
public void activate(MQePropertyProvider info) throws java.lang.Exception
Initialises a new MQeTcpipAdapter object.
While the MQeTcpipAdapter is not intended for use by MQe, this method should be called inside the activate method of all the adapters that extend this class.
activate
in class MQeCommunicationsAdapter
java.lang.Exception
- DefaultTimeOut = 5000 DefaultPacketSize = 4096 DefaultRetry = 3
These properties should be changed with care, only if you understand the ramifications of altering the time out or packet size should they be altered.
These properties may be set by the command line parameter to the JVM using the -D option, for instance -Dcom.ibm.mqe.adapters.MQeCommunicationsAdapter.Timeout=500 or within a program using the System.setProperties() method, for instance System.setProperties("com.ibm.mqe.adapters.MQeCommunicationsAdapter.Timeout", "500").
Usage Example :
super.activate(MQePropertyProvider);MQeCommunicationsAdapter.COMMS_ADAPTER_ADDRESS
,
MQeCommunicationsAdapter.COMMS_ADAPTER_PORT
,
MQeCommunicationsAdapter.COMMS_ADAPTER_LISTEN
,
MQeCommunicationsAdapter.COMMS_ADAPTER_TIMEOUT
,
MQeCommunicationsAdapter.COMMS_ADAPTER_PKTSIZE
,
MQeCommunicationsAdapter.COMMS_ADAPTER_RETRIES
,
com.ibm.mqe.adapters.MQeCommunicationsAdapter#COMMS_ADAPTER_THREAD_STOP_CHECK
public void close() throws java.lang.Exception
Closes the current MQeTcpipAdapter object.
Closes the current adapter so that it can no longer be read from or written to.
close
in class MQeCommunicationsAdapter
java.lang.Exception
public void open() throws java.lang.Exception
Opens a socket for use.
If this is a listening adapter then a new server socket is created. Otherwise a new socket is created.
open
in class MQeCommunicationsAdapter
java.lang.Exception
- Usage Example :
super.open();public byte[] readLength(int recordSize) throws java.lang.Exception
Reads bytes from the underlying TCP/IP stream.
recordSize
- An integer that specifies the maximum buffer size to read in one go.
If this parameter is less than or equal to zero, then the variable
adapterPacketSize is used. *
java.io.EOFException
- If no more data is available.
java.lang.Exception
- Usage Example :
byte []results =super.read(4096);public java.lang.String readln() throws java.lang.Exception
Reads a line of data from the underlying TCP/IP stream.
java.io.EOFException
- If no more data is available.
java.lang.Exception
- Usage Example :
String results =super.readln(null);public void temporaryClose() throws java.lang.Exception
If the adapter is not persistent calls the close method
temporaryClose
in class MQeCommunicationsAdapter
java.lang.Exception
- Usage Example :
super.close();public MQeCommunicationsAdapter waitForContact(MQePropertyProvider info) throws java.lang.Exception
Only valid for a listening adapter, the adapter waits on a named socket for an incoming connection request.
waitForContact
in class MQeCommunicationsAdapter
info
- contains the property information that is used to create a new adapter.
This will need to contain the following fields, as well as the fields
required to start the adapter.
MQeException
- If the parameter object was not correct for the
given option.
java.lang.Exception
- Usage Example :
MQeCommunicationsAdapter.COMMS_ADAPTER_CLASS
,
MQeCommunicationsAdapter.COMMS_ADAPTER_LISTEN
,
* @return MQeCommunicationsAdapter, this is the adapter that was created as
a result of a connection request
|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |