Package com.ibm.mq.headers
Class MQHeaderRegistry
java.lang.Object
com.ibm.mq.jmqi.JmqiObject
com.ibm.mq.headers.MQHeaderRegistry
- All Implemented Interfaces:
MQHeaderFactory.Registry
public class MQHeaderRegistry
extends com.ibm.mq.jmqi.JmqiObject
implements MQHeaderFactory.Registry
The MQHeaderRegistry provides resources for decoding or instantiating header instances. The
registry associates message formats and header types with MQHeaderFactories that can decode or
create headers. Most applications will not have to use this class directly. The MQHeaderIterator
and MQHeaderList classes use the default header registry as the basis for their capabilities, and
this is pre-registered with the standard MQ message formats and header types. The default header
registry can be obtained directly using the getDefault method on this class.
Applications may register additional MQHeaderFactory instances in the default registry, for example, if new MQ or application header types are devised. As a convenience, new MQHeader types can be registered directly without supplying an MQHeaderFactory instance, as long as each header type is associated one-to-one with a format. (For most existing headers, this is the case; but it is not true of PCF, for example.)
As an alternative to updating the default registry, applications can create their own MQHeaderRegistry instances and customize their contents, for example to handle custom application-defined formats. An MQHeaderIterator can be created from any MQHeaderRegistry using the createIterator method.
- See Also:
-
Field Summary
Fields inherited from class com.ibm.mq.jmqi.JmqiObject
COMP_JM, COMP_JN, COMP_JO -
Method Summary
Modifier and TypeMethodDescriptioncreateIterator(DataInput message) createIterator(DataInput message, String format, int encoding, int characterSet) static MQHeaderRegistrygetFactoryForFormat(String format) getFactoryForType(String type) Collection<?> Collection<?> voidregister(MQHeaderFactory factory) Registers an MQHeaderFactory.voidvoidtoString()Methods inherited from class com.ibm.mq.jmqi.JmqiObject
getJmqiEnvironment
-
Method Details
-
getDefault
- Returns:
- the default (singleton) MQHeaderRegistry instance.
-
getFactoryForFormat
- Specified by:
getFactoryForFormatin interfaceMQHeaderFactory.Registry- Parameters:
format-- Returns:
- an MQHeaderFactory associated with the specified format.
- See Also:
-
getFactoryForType
- Specified by:
getFactoryForTypein interfaceMQHeaderFactory.Registry- Parameters:
type-- Returns:
- an MQHeaderFactory that supports the specified header type.
- See Also:
-
register
Description copied from interface:MQHeaderFactory.RegistryRegisters an MQHeaderFactory.- Specified by:
registerin interfaceMQHeaderFactory.Registry- Parameters:
factory-- See Also:
-
register
- Parameters:
format-type-headerClass-
-
register
- Parameters:
format-type-className-- Throws:
ClassNotFoundException
-
getRegisteredFormats
- Specified by:
getRegisteredFormatsin interfaceMQHeaderFactory.Registry- Returns:
- the set of formats supported by the registered MQHeaderFactories.
- See Also:
-
getRegisteredTypes
- Specified by:
getRegisteredTypesin interfaceMQHeaderFactory.Registry- Returns:
- the set of header types supported by the registered MQHeaderFactories.
- See Also:
-
createIterator
- Parameters:
message- the message.- Returns:
- an MQHeaderIterator capable of decoding messages of formats known to this registry.
-
createIterator
public MQHeaderIterator createIterator(DataInput message, String format, int encoding, int characterSet) - Parameters:
message- the message.format-encoding- the numeric encoding. see (CMQC.MQENC_* for values).characterSet- the Coded Character Set Identifier.- Returns:
- an MQHeaderIterator capable of decoding messages of formats known to this registry.
-
toString
-