public interface WMQSendExit
Note: This interface does not apply when connecting directly to WebSphere MQ in bindings mode.
To provide your own send exit, define a class that implements this interface.
For example,
// in MySendExit.java
package acme.exits;
class MySendExit implements WMQSendExit
{
// you must provide an implementation of the channelSendExit method
public ByteBuffer channelSendExit(MQCXP channelExitParms,
MQCD channelDefinition,
ByteBuffer agentBuffer)
{
// your exit code goes here...
}
}
To use your send exit with WebSphere MQ Classes for Java, create a new instance of your class and assign it to the com.ibm.mq.MQEnvironment.channelSendExit()field before constructing your MQQueueManager object.
For example,
// in your main program...
MQEnvironment.channelSendExit = new acme.exits.MySendExit();
... // other initialisation
MQQueueManager qMgr = new MQQueueManager("");
To use your send exit with WebSphere MQ Classes for JMS, specify the name of the class using com.ibm.mq.jms.MQConnectionFactory.setSendExit(String) before getting a connection.
For example,
// in your main program...
MQQueueConnectionFactory mqcf = new MQQueueConnectionFactory();
mqcf.setSendExit("acme.exits.MySendExit");
// set the other parameters in the MQQueueConnectionFactory here...
MQQueueConnection mqqc =(MQQueueConnection)mqcf.createQueueConnection();
| Modifier and Type | Method and Description |
|---|---|
java.nio.ByteBuffer |
channelSendExit(MQCXP channelExitParms,
MQCD channelDefinition,
java.nio.ByteBuffer agentBuffer)
The send exit method that your class must provide.
|
java.nio.ByteBuffer channelSendExit(MQCXP channelExitParms, MQCD channelDefinition, java.nio.ByteBuffer agentBuffer)
channelExitParms - contains information about the context in which the exit is being
invoked. channelExitParms.setExitResponse(int) sets a parameter
which you use to tell the WebSphere MQ Client for Java what action to take next.channelDefinition - contains details of the channel through which all communications with
the queue manager take place.agentBuffer - contains the data received from the queue manager if
channelExitParms.getExitReason() is CMQXC.MQXR_XMIT.
Otherwise pAgentBuffer is null.MQCXP,
MQCD