|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--examples.mqbridge.transformers.MQeListTransformer
A simple MQ to MQe transformer class.
This transformer does not actually understand the format of any messages it is passed.
It has an ordered list of smaller transformers. When a message needs to be transformed, this class will work through its list of transformers one by one, presenting the message to each transformer. The results of the first transformer to successfully return a converted message are returned to the user of this class.
This style of transformer could be used in conjunctions with a collection of smaller transformers, where each "small" transformer understands a limited number of message formats.
This class keeps its list of transformers in a static ordered list (array) but it could easily have read the list from a file when the activate method is called, or obtained a list through some other method (possibly using the user-defined parameters passed on the activate method to do so).
Field Summary | |
protected java.lang.String[] |
transformerClassName
The ordered list of names of transformers. |
protected MQeTransformerInterface[] |
transformerInstance
A list of transformers which are loaded and ready for use. |
static short[] |
version
|
Constructor Summary | |
MQeListTransformer()
|
Method Summary | |
void |
activate(java.util.StringTokenizer userParameters)
Tells the class implementing this interface any parameters that may have been supplied with the transformer definition. |
com.ibm.mq.MQMessage |
transform(MQeMsgObject msg,
MQeMQBridgeQueue queue,
com.ibm.mq.MQPutMessageOptions options)
Converts an MQe format message into an MQ format message. |
MQeMsgObject |
transform(com.ibm.mq.MQMessage msg,
java.lang.String remoteQMgrName,
java.lang.String remoteQName)
Converts an MQ format message into an MQe format message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static short[] version
protected java.lang.String[] transformerClassName
protected MQeTransformerInterface[] transformerInstance
Constructor Detail |
public MQeListTransformer()
Method Detail |
public void activate(java.util.StringTokenizer userParameters) throws java.lang.Exception
This example class could have used the parameters to build its list of transformers, but to keep this example short, we ignore any parameters.
activate
in interface MQeTransformerInterface
userParameters
- StringTokenizer containing the transformer
definition parameters.
java.lang.Exception
public MQeMsgObject transform(com.ibm.mq.MQMessage msg, java.lang.String remoteQMgrName, java.lang.String remoteQName) throws java.lang.Exception
transform
in interface MQeTransformerInterface
msg
- The WMQ message object we are to transform.remoteQMgrName
- The Destination Remote Queue Manager Name
(from the MQ Remote Queue Definition)remoteQName
- The Destination Remote Queue Name (from the
MQ Remote Queue Definition).
java.lang.Exception
public com.ibm.mq.MQMessage transform(MQeMsgObject msg, MQeMQBridgeQueue queue, com.ibm.mq.MQPutMessageOptions options) throws java.lang.Exception
transform
in interface MQeTransformerInterface
queue
- A reference to the MQe queue the put the message.
(e.g. For determining default expiry time etc...)options
- A reference to an Integer object in which any required
MQPutMessageOptions.options values should be placed.msg
- The Websphere WebSphere MQ Everyplace message that is to be transformed.
java.lang.Exception
|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |