|
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.MQe
The base class from which most of the other MQe classes inherit.
It contains various useful symbolic constant definitions and utility methods to assist with the programming of MQe.
Under normal circumstances application classes may find it useful to inherit from this class.
In previous releases of the product, many MQe_Adapter_* constants were defined in this class. These have been move to the MQeAdapter class.
Field Summary | |
static java.lang.String |
Admin_Queue_Name
The default name given to the administration queue on a queue manager. |
static java.lang.String |
Admin_Reply_Queue_Name
The default name given to a local queue to which replies from admin messages can be sent to. |
static java.lang.String |
copyright
The copyright statement under which all MQe classes are protected. |
static java.lang.String |
DeadLetter_Queue_Name
The default name given to a local queue on which undeliverable messages can be deposited. |
static int |
Event_Activate
|
static int |
Event_Attribute
|
static int |
Event_Authenticate
|
static int |
Event_Close
|
static int |
Event_Logoff
|
static int |
Event_Logon
|
static int |
Event_MiniCert_Validate
|
static int |
Event_Queue
|
static int |
Event_QueueManager
|
static int |
Event_UserBase
|
static java.lang.String |
JMS_Version
A value indicating that an MQeMsgObject is wrapping a JMS message. |
static java.lang.String |
MQ_Headers
This is an array of Bytes field. |
static byte |
MQe_Log_Audit_Failure
|
static byte |
MQe_Log_Audit_Success
|
static byte |
MQe_Log_Error
|
static byte |
MQe_Log_Information
|
static byte |
MQe_Log_Success
|
static byte |
MQe_Log_Warning
|
static java.lang.String |
Msg_BackoutCount
The name of the field containing a backout count. |
static java.lang.String |
Msg_CorrelID
The name of the field in a message used to contain a correlation identifier. |
static java.lang.String |
Msg_ExpireTime
The name of a field in a message which indicates when the message should expire. |
static java.lang.String |
Msg_LockID
The name used to hold a long key value. |
static java.lang.String |
Msg_MsgID
The name of the field in a message used to contain a message identifier. |
static java.lang.String |
Msg_OriginQMgr
The name of the field in a message which contains the name of the MQe queue manager from which a message was originally put. |
static java.lang.String |
Msg_Priority
The name of the byte field in a message which contains the priority of the message. |
static java.lang.String |
Msg_ReplyToQ
The name of the Ascii field which is often used to indicate which queue a reply message should be sent. |
static java.lang.String |
Msg_ReplyToQMgr
The name of the Ascii field which is often used to indicate which queue manager a reply message should be sent. |
static java.lang.String |
Msg_Resend
The name of a boolean field which is used to indicate that a message is being re-sent. |
static java.lang.String |
Msg_Style
The name of an int field which is used to indicate the style of a message. |
static int |
Msg_Style_Datagram
A value which may be placed in the Msg_Style field of a message. |
static int |
Msg_Style_Reply
A value which may be placed in the Msg_Style field of a message. |
static int |
Msg_Style_Request
A value which may be placed in the Msg_Style field of a message. |
static java.lang.String |
Msg_Time
The name of a long field used in every MQe message. |
static java.lang.String |
Msg_WrapMsg
The name of a byte array field which is used to hold the wrapped message. |
static java.lang.String |
sccsid
Holds a string indicating the exact build level from which this class was taken. |
static java.lang.String |
System_Default_Queue_Name
The name of a local queue which is often created on a queue manager. |
static short[] |
version
Holds an array of short values indicating the version of the MQe product being used. |
Constructor Summary | |
MQe()
Constructs an MQe object. |
Method Summary | |
static java.lang.String |
abbreviate(java.lang.String className,
int index)
Resolves an abbreviated class name, or abbreviates a class name. |
static void |
alias(java.lang.String from,
java.lang.String to)
To add or remove a class alias from a static table held within MQe. |
static byte[] |
asciiToByte(java.lang.String data)
To convert an String containing Ascii invariant characters to a byte array, preserving only the low byte of each character. |
static java.lang.String |
byteToAscii(byte[] data)
To convert a byte array to an Ascii string. |
static java.lang.String |
byteToHex(byte[] data)
Converts a byte array to a String containing the character Hex representation of the data. |
static java.lang.String |
byteToHex(byte[] data,
int offset,
int count)
Converts selected elements of a byte array to a String containing the character Hex representation of the data. |
static int |
byteToInt(byte[] data,
int offset)
Converts four selected consecutive elements of a byte array to a integer value. |
static long |
byteToLong(byte[] data,
int offset)
Converts eight selected consecutive elements of a byte array to a long value. |
static short |
byteToShort(byte[] data,
int offset)
Convert two selected consecutive elements of a byte array to a short integer value. |
static java.lang.String |
byteToUnicode(byte[] data)
To convert an entire byte array to a Unicode string. |
static java.lang.String |
fileSeparator()
String to get file separator from System, rather than using File |
static MQeEventLogInterface |
getEventLogHandler()
To get the MQe Event Log handler object which was previously set using the setEventLogHandler method. |
static java.lang.String |
hexToAscii(java.lang.String data)
Converts a character hex array to an ascii String. |
static byte[] |
hexToByte(java.lang.String data)
Converts a character hex array to bytes. |
static byte[] |
intToByte(int data)
Converts an integer value to 4 bytes of a byte array. |
static boolean |
isCLDC()
Used to determine if JVM is CLDC compliant. |
static java.lang.Class |
loadClass(java.lang.String className,
boolean resolve)
Return an instance of class Class representing the named class. |
static java.lang.Object |
loadObject(java.lang.String className)
Load and return an instance of the named class. |
static void |
log(byte logType,
int logNumber,
java.lang.Object logData)
Write to the registered event log handler. |
static MQeEventLogInterface |
setEventLogHandler(MQeEventLogInterface logObj)
Set MQe an Event Log handler object. |
static MQeLoader |
setLoader(MQeLoader newLoader)
Allows a solution to plug-in their own loader. |
static byte[] |
sliceByteArray(byte[] data,
int offset,
int length)
Subset of a byte array. |
java.lang.String |
type()
Return the string name of the object. |
static byte[] |
unicodeToByte(java.lang.String data)
Converts an Unicode string to a byte array. |
static long |
uniqueValue()
Generate a long value which is unique within the current JVM. |
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 copyright
MQe myMQe = new MQe(); System.out.println("MQe class is protected by this copyright statement: " + myMQe.copyright);
public static final java.lang.String sccsid
This information can be used by user programs to identify the exact version of MQe in use within the solution programmatically.
MQe myMQe = new MQe(); System.out.println("MQe class identification information : " + myMQe.sccsid);
public static short[] version
This allows programmers to output information on the version of MQe being used in about panels, diagnostics material and other places.
MQe myMQe = new MQe(); short version[] = myMQe.version; String versionString = Short.toString(version[0]); for (int i = 1; i < version.length; i += 1) { versionString = versionString + "." + Short.toString(version[i]); } // versionString is now in format "x.x.x.x"
public static final java.lang.String Msg_CorrelID
The field should be of type ArrayOfByte.
If the application uses this field as a filter on a queue, the filter operation may run faster than if an arbitrary named filter field is used.
// Create an MQeFields object we can use as a filter. MQeFields myFilter = new MQeFields(); String myString = new String("012345"); // Put the correlation identifier we want to filter on into a byte array. byte[] correlID = myString.getBytes(); // Put the correlation identifier into the filter myFilter.putArrayOfByte(com.ibm.mqe.MQe.Msg_CorrelID, correlID); // Get a message which matches my filter. // ie: Any message with 012345 in the correl id field. MQeMsgObject msgReceived = myQueueManager.getMessage( "MsgSourceQMgr", "MsgSourceQ", myFilter, null // No compression, encryption or authentication attributes on the queue. , 0 // Not going to confirm the get later. );
public static final java.lang.String Msg_MsgID
The field should be of type ArrayOfByte.
If the application uses this field as a filter on a queue, the filter operation may run faster than if an arbitrary named filter field is used.
// Create an MQeFields object we can use as a filter. MQeFields myFilter = new MQeFields(); String myString = new String("012345"); // Put the message identifier we want to filter on into a byte array. byte[] msgID = myString.getBytes(); // Put the message identifier into the filter myFilter.putArrayOfByte(com.ibm.mqe.MQe.Msg_MsgID, msgID); // Get a message which matches my filter. // ie: Any message with 012345 in the message id field. MQeMsgObject msgReceived = myQueueManager.getMessage( "MsgSourceQMgr", "MsgSourceQ", myFilter, null // No compression, encryption or authentication attributes on the queue. , 0 // Not going to confirm the get later. );
public static final java.lang.String Msg_OriginQMgr
The type of the field is an ASCII field.
User applications should not attempt to set this field or manipulate it in any way, though it will be available to read once a message has arrived on a queue.
The field is added to a message by the putMessage method.
To remove this field from a message object, use the com.ibm.mqe.MQeMsgObject.resetUIDFields method.
MQeMsgObject.resetMsgUIDFields()
,
Constant Field Values// Get a message which matches any filter. MQeMsgObject msgReceived = myQueueManager.getMessage( "MsgSourceQMgr", "MsgSourceQ", null // No filter , null // No compression, encryption or authentication attributes on the queue. , 0 // Not going to confirm the get later. ); // Find out who sent the message. String messageOrigin = msgReceived.getAscii(MQe.Msg_OriginQMgr);
public static final java.lang.String Msg_Priority
The type of the field is a byte field.
Valid range 0 to 9. 0 being the lowest priority, 9 being the highest priority.
Messages with a higher priority may, though will not always, be delived to a target queue before some lower priority messages, even if posted after such lower-priority messages.
byte priority = 9; // Highest priority of a message MQeMsgObject msg = new MQeMsgObject(); msg.putByte(MQe.Msg_Priority, priority); // The message will now travel as fast as it can over the network
public static final java.lang.String Msg_Time
The field referred to by this name holds a long millisecond timestamp taken at the time the message is created. Milliseconds elapsed since midnight, January 1, 1970 UTC.
Applications should never attempt to modify or put a field using this field name into a message, though they may read the data using the getLong method.
The timestamp inside the message cannot be removed unless the MQeMsgObject.resetMsgUIDFields method is used.
MQeMsgObject.resetMsgUIDFields()
,
Constant Field Values// Create a new message. MQeMsgObject msg = new MQeMsgObject(); // Extract the time the message was created. long timeOfCreation = msg.getLong(MQe.Msg_Time);
public static final java.lang.String Msg_ReplyToQ
The field is an Ascii field. If used, it should contain the name of an MQe queue. This field is used by administration messages, to inform the admnistration queue processing the message where replies should be sent.
Often used in conjunction with the MQe.Msg_ReplyToQMgr field.
Msg_ReplyToQMgr
,
Constant Field Values// Create a new administration message to create a local queue MQeQueueAdminMsg msg = new MQeQueueAdminMsg(); // Set the reply-to queue name in the administration message to // the normal place to which replies are sent. msg.putAscii(MQe.Msg_ReplyToQ, MQe.Admin_Reply_Queue_Name); // Set the reply-to queue manager name in the administration message // to indicate which queue manager the reply should be sent to. msg.putAscii(MQe.Msg_ReplyToQMgr, "MyQMgr");
public static final java.lang.String Msg_ReplyToQMgr
The field is an Ascii field. If used, it should contain the name of an MQe queue manager. This field is used by administration messages, to inform the admnistration queue processing the message where replies should be sent.
Often used in conjunction with the MQe.Msg_ReplyToQ field.
Msg_ReplyToQ
,
Constant Field Values// Create a new administration message to create a local queue MQeQueueAdminMsg msg = new MQeQueueAdminMsg(); // Set the reply-to queue name in the administration message to // the normal place to which replies are sent. msg.putAscii(MQe.Msg_ReplyToQ, MQe.Admin_Reply_Queue_Name); // Set the reply-to queue manager name in the administration message // to indicate which queue manager the reply should be sent to. msg.putAscii(MQe.Msg_ReplyToQMgr, "MyQMgr");
public static final java.lang.String Msg_Style
Allowable values in the Msg_Style field are:
Msg_Style_Datagram
,
Msg_Style_Request
,
Msg_Style_Reply
,
Constant Field Values// Create a new administration message to create a local queue MQeQueueAdminMsg msg = new MQeQueueAdminMsg(); // Indicate that this message requires a response. msg.putInt(MQe.Msg_Style, MQe.Msg_Style_Request);
public static final java.lang.String Msg_LockID
The name used to hold a long key value. The key is necessary to unlock a message.
public static final java.lang.String Msg_Resend
If the WebSphere MQ Everyplace application retransmits the message, it should also inform the target queue manager that this is happening. The target queue manager deletes any duplicate copy of the message that it already has. The application sets the MQe.Msg_Resend field to do this.
// Create a message to send. MQeMsgObject msg = new MQeMsgObject(); // ... pack the message with data... // ... attempt to put the message... // ... attempt to put the message failed... // Mark the message as a retry before sending it again. msg.putBoolean(MQe.Msg_Resend, true); // ... attempt to put the message again...
public static final java.lang.String Msg_ExpireTime
The name of a field in a message which indicates when the message should expire.
This field is optional in a message. If missing, then an expiry time attribute of a queue may cause a message to be expired.
Expired messages are removed from the system.
This field has two forms, depending on the type of the information put into the message with this name.
If the field is an Integer field, then the value represents the number of milliseconds after
the message creation time at which the message will expire.
A special value of 0 or less indicates that the message will never expire.
The Msg_Time
field holds the time the message was created.
If the field is a Long field, then the value represents the exact time after which the message will expire. This is expressed in milliseconds since midnight, January 1, 1970 UTC. A special value of 0L indicates that the message will never expire.
MQeMsgObject
,
Constant Field Valuespublic static final java.lang.String Msg_WrapMsg
The name of a byte array field which is used to hold the wrapped message. Wrapped message is to ensure data protection.
public static final java.lang.String Msg_BackoutCount
public static final java.lang.String JMS_Version
public static final int Msg_Style_Datagram
Use this value to indicate that the message contains a command not requiring a reply.
Msg_Style
,
Constant Field Valuespublic static final int Msg_Style_Request
Use this value to indicate that the message contains a command which requires a reply.
Msg_Style
,
Constant Field Values// Create a new administration message to create a local queue MQeQueueAdminMsg msg = new MQeQueueAdminMsg(); // Indicate that this message requires a response. msg.putInt(MQe.Msg_Style, MQe.Msg_Style_Request);
public static final int Msg_Style_Reply
Use this value to indicate that the message contains a reply to a previous command.
Msg_Style
,
Constant Field Valuespublic static final java.lang.String Admin_Queue_Name
public static final java.lang.String Admin_Reply_Queue_Name
When administration messages are sent to a queue manager, a reply queue and queue manager name are specified. This queue and queue manager name is the target location to which a response to the administration message is sent.
Often the queue to which such responses are sent is one with a name matching the value of this constant ("AdminReplyQ").
// Create a new administration message to create a local queue MQeQueueAdminMsg msg = new MQeQueueAdminMsg(); // Set the reply-to queue name in the administration message to // the normal place to which replies are sent. msg.putAscii(MQe.Msg_ReplyToQ, MQe.Admin_Reply_Queue_Name); // Set the reply-to queue manager name in the administration message // to indicate which queue manager the reply should be sent to. msg.putAscii(MQe.Msg_ReplyToQMgr, "MyQMgr");
public static final java.lang.String DeadLetter_Queue_Name
public static final java.lang.String System_Default_Queue_Name
The queue with this name is often used by systems administrators to put test messages to, to verify that the transmission and routing paths between queue managers is configured correctly, and working.
public static final byte MQe_Log_Success
public static final byte MQe_Log_Error
public static final byte MQe_Log_Warning
public static final byte MQe_Log_Information
public static final byte MQe_Log_Audit_Success
public static final byte MQe_Log_Audit_Failure
public static final int Event_Activate
public static final int Event_Close
public static final int Event_Logon
public static final int Event_Logoff
public static final int Event_QueueManager
public static final int Event_Queue
public static final int Event_Attribute
public static final int Event_Authenticate
public static final int Event_MiniCert_Validate
public static final int Event_UserBase
public static final java.lang.String MQ_Headers
This is an array of Bytes field. This is used to hold various MQ headers (RFH) present in the message.
Constructor Detail |
public MQe()
import com.ibm.mqe.MQe; MQe myMQeInstance = new com.ibm.mqe.MQe();
Method Detail |
public static final boolean isCLDC()
public static final java.lang.String fileSeparator()
public static java.lang.String abbreviate(java.lang.String className, int index)
An abbreviated class name is of the form "n:" where n is an number representing an MQe class name.
For example, "6:" would resolve to "com.ibm.mqe.MQeTransporter".
For example, "com.ibm.mqe.MQeTransporter" would resolve to "6:".
className
- A String containg the search name to be resolved into an abbreviated form, or
to be un-resolved from an abbreviated for.
Whether it is resolved to or from an abbreviated form is dictated by the value of the
index parameter.index
- An integer indicating the action to perform.
// Find the abbreviation of the MQe transporter class String abbreviatedClassName = MQe.abbreviate("com.ibm.mqe.MQeTransporter", 1); // Will return the string value "6:" System.out.println("abbreviation of com.ibm.mqe.MQeTransporter is " + abbreviatedClassName); // Will print the string "abbreviation of com.ibm.mqe.MQeTransporter is 6:" // Convert the abbreviated form of the class name into the full name again. String originalClassName = MQe.abbreviate(abbreviatedClassName, 0); // Will return the string value "com.ibm.mqe.MQeTransporter" System.out.println("unabbreviation of " + abbreviatedClassName + " is " + originalClassName); // Will print the string "unabbreviation of 6: is com.ibm.mqe.MQeTransporter
public static void alias(java.lang.String from, java.lang.String to) throws java.lang.Exception
An alias is a syntactic mapping from one string to another. Use this method to add a mapping to the table held within MQe, or remove a mapping which already exists.
This mechanism is sometimes used in MQe to map from an abstract name of a java class, to the fully specified class name.
Adding an alias which already exists in the alias table causes its' value to be replaced with the new one specified.
By default, some pre-defined aliases are provided. We recommend you do not remove these from the alias table, or over-write the values they map to.
The pre-defined aliases are :
from
- The name of the string which is to be mapped to another string,
or removed from the MQe table of aliases.
This can be thought of as the 'alias' of the string passed on the
'to' parameter.
A null pointer exception will result if this value is null.to
- The name to which the 'from' string will be mapped.
If you specify null, then the 'from' string will be removed
from the alias mapping table.
java.lang.Exception
- Doesn't throw anything// Add an alias such that the text "mypackage.mysubpackage.MyClass" can be referred // to by the text string "MyClass" myMQe.alias("MyClass", "mypackage.mysubpackage.MyClass"); // Remove the alias myMQe.alias("MyClass", null);
public static byte[] asciiToByte(java.lang.String data)
data
- A Unicode string, where each characgter in that string is an invariant Ascii character.
The most significant 8 bits of the 16 bits of the character code is discarded during the
conversion performed by this method.
byte data[] = MQe.asciiToByte("A piece of test data");
public static java.lang.String byteToAscii(byte[] data)
data
- byte array which is to be converted to an Ascii string.
byte[] myData = new byte[] { 64, 65, 66, 67, 68 }; String results = MQe.byteToAscii(myData);
public static java.lang.String byteToHex(byte[] data)
Each byte value is converted into 2 characters, each in the range '0' to 'F'.
data
- byte array to convert to character hex
// Put our example data into a byte array. byte[] byteData = new byte[] { 8, 9, 10, 11, 12 }; // Convert the 2nd and 3rd elements to hexadecimal string. String hexResults = MQe.byteToHex(byteData); // Returns the string "08090A0B0C"
public static java.lang.String byteToHex(byte[] data, int offset, int count)
Each byte value is converted into 2 characters, each in the range '0' to 'F'.
data
- byte array to convert to character hexoffset
- integer offset into data arraycount
- integer byte count of array elements to convert
// Put our example data into a byte array. byte[] byteData = new byte[] { 8, 9, 10, 11, 12 }; // Convert the 2nd and 3rd elements to hexadecimal string. String hexResults = MQe.byteToHex(byteData, 1, 2); // Returns the string "090A"
public static int byteToInt(byte[] data, int offset)
data
- byte array containing the four bytes to convert to an integeroffset
- integer offset into data array of the first of four bytes of data
used in the conversion.
byte[] myByteData = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; // Use the bytes containing 2,3,4 and 5 into an int int result = MQe.byteToInt(myByteData, 2); // result is now 33752069
public static long byteToLong(byte[] data, int offset)
data
- byte array containing the eight bytes to convert to a longoffset
- integer offset into data array of the first of eight bytes of data
used in the conversion.
byte[] myByteData = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; // Use the bytes containing 1,2,3,4,5,6,7,and 8 into a long long result = MQe.byteToLong(myByteData, 1); // result is now 72623859790382856
public static short byteToShort(byte[] data, int offset)
data
- byte array containing the data to convert to a shortoffset
- integer offset into data array of first of two bytes of data used
in the conversion.
byte[] myByteData = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; // Use the bytes containing 1,2,3,4,5,6,7,and 8 into a long long result = MQe.byteToShort(myByteData, 1); // result is now 258
public static java.lang.String byteToUnicode(byte[] data)
data
- byte array containing the data to convert to a Unicode string.
Each pair of bytes in the array are used to form a Unicode
character.
If there are an odd number of bytes in the array, the last byte
is not used.
byte[] myByteData = new byte[] { 0, 65, 0, 66, 0, 67, 0, 68, 0 }; String result = MQe.byteToUnicode(myByteData); // result is now "ABCD"
public static MQeEventLogInterface getEventLogHandler()
setEventLogHandler(com.ibm.mqe.MQeEventLogInterface)
public static java.lang.String hexToAscii(java.lang.String data) throws java.lang.Exception
data
- hex character string to convert to ascii.
MQeException
- Except_BadRequest - The input string has an odd number of characters.
java.lang.Exception
public static byte[] hexToByte(java.lang.String data) throws java.lang.Exception
data
- hex character string to convert
MQeException
- Except_Syntax
java.lang.Exception
public static byte[] intToByte(int data)
data
- int value to a byte array
public static final java.lang.Class loadClass(java.lang.String className, boolean resolve) throws java.lang.ClassNotFoundException
The className must be either a valid class on the classpath, or an alias for a valid class on the classpath.
The loader set using the setLoader method will be used to load the class.
java.lang.ClassNotFoundException
setLoader(com.ibm.mqe.MQeLoader)
public static final java.lang.Object loadObject(java.lang.String className) throws java.lang.Exception
The className must be either a valid class on the classpath, or an alias for a valid class on the classpath.
The class specified must be loadable, and must have a default (no argument) constructor.
The loader set using the setLoader method will be used to instantiate the object from the class name.
java.lang.ClassNotFoundException
java.lang.Exception
setLoader(com.ibm.mqe.MQeLoader)
public static void log(byte logType, int logNumber, java.lang.Object logData)
This method might be useful to an application developer to post entries to the MQe event log.
There is some example code in the examples\eventlog directory.
MQe trace entries may also be directed to the log by changing the modifier in the examples\trace\MQeTraceResource.java file.
logType
- byte value of the type of log entry (e.g. MQe_Log_SUCCESS)logNumber
- int log entry numberlogData
- Object data associated with the log entrypublic static MQeEventLogInterface setEventLogHandler(MQeEventLogInterface logObj)
logObj
- a Log object to receive Log requests
getEventLogHandler()
public static final MQeLoader setLoader(MQeLoader newLoader)
All MQe dynamic loads are performed by the MQe.loadObject or MQe.loadClass methods. These methods in turn call a separate class and object loader.
The MQe class initially starts with an instance of the com.ibm.mqe.MQeLoader class being used as the provider of dynamic loading capability.
This method allows user code to change the way in which MQe and user classes are loaded, and objects instantiated from those classes.
For example, if the solution wishes to load classes using a different mechanism to the default java class loader, the MQeLoader class could be subclassed, and methods over-ridden to achieve the desired effect.
All calls to the loadObject and loadClass methods after this method has been used will invoke the loadObject and loadClass methods on the loader.
newLoader
- The new loader to use when loading classes dynamically, and instantiating
instances of those classes. Must be derived from the com.ibm.mqe.MQeLoader class.
If set to null, it will NOT clear the loader currently being used, but will return
a reference to the current loader.
public static byte[] sliceByteArray(byte[] data, int offset, int length)
data
- byte array to be slicedoffset
- integer offset into data array
public java.lang.String type()
Used by subclasses to obtain a potentially shortened string which represents their class name
abbreviate(java.lang.String, int)
public static byte[] unicodeToByte(java.lang.String data)
data
- a String to be converted to a byte array
public static long uniqueValue() throws java.lang.Exception
Using this method, you can obtain values which will be unlikely to match any other values returned to any other callers of this method.
Amongst other things, this is often used to allocate a unique value for a request-style messages, where replies to that message carry the same id.
The field in which the value sits can be used to efficiently filter looking for that exact reply field. For example, this technique is often used when issuing administration messages to a queue manager.
This method is thread-safe.
java.lang.InterruptedException
java.lang.Exception
long value1 = MQe.uniqueValue(); long value2 = MQe.uniqueValue(); // value1 will not be equal to value2
|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |