|
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
This is the base class that provides the generic adapter features. It provides abstract classes or implements all methods that communications adapters need to implement. Any new communications adapter must inherit from MQeCommunicationsAdapter.
The documentation supplied for the communications adapters assumes the reader knows and understands the respective protocol being disussed. For instance when discussing an IP protocol we shall not explain how to use the ping command.
Field Summary | |
static java.lang.String |
COMMS_ADAPTER_ADDRESS
String used as a key for the address of the queue manager running a listener in order for the client to connect. |
static java.lang.String |
COMMS_ADAPTER_CLASS
String used as a key to retrieve the adapter class. |
static java.lang.String |
COMMS_ADAPTER_GROUP_SIZE
String used as a key for the number of datagram packets to be sent by the a UDP adapter before an acknowledgement is expected. |
static java.lang.String |
COMMS_ADAPTER_HTTP_VERSION
String used as a key to provide the version of HTTP the MQeTcpipHttpAdapter should use. |
static java.lang.String |
COMMS_ADAPTER_LISTEN
String used as a key for the listening option for a communciations adapter. |
static java.lang.String |
COMMS_ADAPTER_NONBLOCKING_TIMEOUT
String used to determine the internal timeout so the adapter may check to see if the current thread has been requested or demanded to be stopped. |
static java.lang.String |
COMMS_ADAPTER_NOPERSIST
String used as a key for the nopersist option, currently only used for a MQeTcpipLengthAdapter. |
static java.lang.String |
COMMS_ADAPTER_PERSIST
String used as a key for the persist option for a communications adapter. |
static java.lang.String |
COMMS_ADAPTER_PKTSIZE
String used as a key for the packet size for the communications adapter. |
static java.lang.String |
COMMS_ADAPTER_PORT
String used as a key to the port number for an IP adapter. |
static java.lang.String |
COMMS_ADAPTER_RETRIES
String used as a key for the maximum number of times the communications adapter will retry in the event of a network failure. |
static java.lang.String |
COMMS_ADAPTER_SERVLET
String used as a key for the servelet name for the HTTP Adapters. |
static java.lang.String |
COMMS_ADAPTER_TIMEOUT
String used as a key for the communications adapter timeout value. |
static java.lang.String |
COMMS_ADAPTER_VARIANCE
String used as a key for the network variance value used by the MQeUdpipBasicAdapter as part of its calculations for timeout and retry to allow for variance within the network. |
protected boolean |
listeningAdapter
boolean used to indicate whether the adapter should be acting as a listener. |
protected boolean |
persistentAdapter
boolean used to indicate whether the adapter should keep the network connection open. |
protected boolean |
responderAdapter
boolean used to indicate whether the adapter should be acting as a responder, that is the adapter has been created by a listening adapter in response to an incoming request. |
Constructor Summary | |
MQeCommunicationsAdapter()
|
Method Summary | |
abstract void |
activate(MQePropertyProvider info)
Used to activate an adapter and should only ever be called once in the life-time of the object. |
abstract void |
close()
Closes an adapter. |
static MQeCommunicationsAdapter |
createNewAdapter(MQePropertyProvider info)
Creates a new communications adapter. |
boolean |
isStopDemanded()
If the return value is true the current thread should stop immediately. |
boolean |
isStopRequested()
If the return value is true the current thread should stop as soon as possible. |
abstract void |
open()
Opens an adapter for use. |
abstract byte[] |
read()
Reads data from the adapter. |
abstract void |
temporaryClose()
Closes a non persistent adapter. |
abstract MQeCommunicationsAdapter |
waitForContact(MQePropertyProvider info)
Used by the listening adapter to wait for incoming data. |
abstract void |
writeData(byte[] data)
Writes a request to the adapter stream. |
abstract void |
writeResponse(byte[] data)
Writes response information to the adapter stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String COMMS_ADAPTER_CLASS
public static final java.lang.String COMMS_ADAPTER_ADDRESS
public static final java.lang.String COMMS_ADAPTER_PORT
public static final java.lang.String COMMS_ADAPTER_LISTEN
MQeProperties
,
Constant Field Valuespublic static final java.lang.String COMMS_ADAPTER_PERSIST
MQeConnectionAdminMsg.Con_AdapterOptions
,
Constant Field Valuespublic static final java.lang.String COMMS_ADAPTER_SERVLET
MQeConnectionAdminMsg.Con_AdapterAsciiParm
,
Constant Field Valuespublic static final java.lang.String COMMS_ADAPTER_RETRIES
MQeUdpipBasicAdapter
,
Constant Field Valuespublic static final java.lang.String COMMS_ADAPTER_TIMEOUT
For instance -Dcom.ibm.mqe.adapters.MQeCommunicationsAdapter.timeout=30000
,
Constant Field Valuespublic static final java.lang.String COMMS_ADAPTER_PKTSIZE
public static final java.lang.String COMMS_ADAPTER_NOPERSIST
for instance -Dcom.ibm.mqe.adapters.MQeCommunicationsAdapter.persist=true
,
Constant Field Valuespublic static final java.lang.String COMMS_ADAPTER_HTTP_VERSION
public static final java.lang.String COMMS_ADAPTER_GROUP_SIZE
public static final java.lang.String COMMS_ADAPTER_VARIANCE
For instance -Dcom.ibm.mqe.adapters.MQeCommunicationsAdapter.variance=5000
,
Constant Field Valuespublic static final java.lang.String COMMS_ADAPTER_NONBLOCKING_TIMEOUT
protected boolean persistentAdapter
protected boolean listeningAdapter
protected boolean responderAdapter
Constructor Detail |
public MQeCommunicationsAdapter()
Method Detail |
public abstract void activate(MQePropertyProvider info) throws java.lang.Exception
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.
java.lang.Exception
- a Java lang exception if an error is encounteredpublic abstract void close() throws java.lang.Exception
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.
IOException
- - An error occurred whilst closing the communications objects.
java.lang.Exception
public abstract void open() throws java.lang.Exception
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.
IOException
- - I/O error occurred.
java.lang.Exception
public abstract byte[] read() throws java.lang.Exception
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.
java.lang.Exception
- Error ocurred whilst reading from the networkpublic abstract void temporaryClose() throws java.lang.Exception
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.
java.lang.Exception
public abstract MQeCommunicationsAdapter waitForContact(MQePropertyProvider info) throws java.lang.Exception
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
java.lang.Exception
public static final MQeCommunicationsAdapter createNewAdapter(MQePropertyProvider info) throws java.lang.Exception
Creates a new communications adapter. This method checks the MQePropertyProvider for the values for COMMS_ADAPTER_CLASS,COMMS_ADAPTER_LISTEN and COMMS_ADAPTER_PERSIST. COMMS_ADAPTER_CLASS is used to retrieve the class of the adapter to load, if COMMS_ADAPTER_LISTEN is returned as "true" then the listeningAdapter variable is set to true, if the COMMS_ADAPTER_PERSIST is returned as "true" then the persistentAdapter variable is set to true.
Note: This entry point is meant to be used by the WebSphere MQ Everyplace object library and classes extending MQeCommunicationsAdapter only.
The MQePropertyProvider is used to obtain all the information required to load the required communications adapter and to correctly activate that adapter
java.lang.Exception
- - not just MQeExceptionspublic abstract void writeData(byte[] data) throws java.lang.Exception
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.
data
- Byte array containing the data to be written.
java.lang.Exception
- Error ocurred whilst writing to the networkpublic abstract void writeResponse(byte[] data) throws java.lang.Exception
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.
data
- Byte array containing the data to be written.
java.lang.Exception
- Error ocurred whilst writing to the network.public boolean isStopRequested()
If the return value is true the current thread should stop as soon as possible.
public boolean isStopDemanded()
If the return value is true the current thread should stop immediately.
|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |