com.ibm.mq.headers
Class MQHeaderRegistry
- java.lang.Object
com.ibm.mq.jmqi.JmqiObject
com.ibm.mq.headers.MQHeaderRegistry
All implemented interfaces:
- public class MQHeaderRegistry
- extends com.ibm.mq.jmqi.JmqiObject
- implements MQHeaderFactory.Registry
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 Type | Method and Description |
|---|---|
createIterator(java.io.DataInput message)
Returns an MQHeaderIterator capable of decoding messages of formats known to this registry.
|
|
createIterator(java.io.DataInput message,java.lang.String format,int encoding,int characterSet)
Returns an MQHeaderIterator capable of decoding messages of formats known to this registry.
|
|
|
getDefault()
Returns the default (singleton) MQHeaderRegistry instance.
|
getFactoryForFormat(java.lang.String format)
|
|
getFactoryForType(java.lang.String type)
|
|
|
getRegisteredFormats()
Returns the set of formats registered in this registry instance.
|
|
getRegisteredTypes()
Returns the set of header types supported by this registry instance.
|
|
register(MQHeaderFactory factory)
|
|
register(java.lang.String format,java.lang.String type,java.lang.Class headerClass)
Registers a new header type associated with a particular format.
|
|
register(java.lang.String format,java.lang.String type,java.lang.String className)
Registers a new header type associated with a particular format.
|
|
toString()
Returns the string representation of the class instance
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail
getDefault
- public static MQHeaderRegistry getDefault( )
Returns the default (singleton) MQHeaderRegistry instance.
getFactoryForFormat
- public MQHeaderFactory getFactoryForFormat( java.lang.String format)
Description copied from interface:
MQHeaderFactory.Registry
Returns an MQHeaderFactory associated with the specified format.
Specified by:
getFactoryForFormat in interface MQHeaderFactory.Registry
getFactoryForType
- public MQHeaderFactory getFactoryForType( java.lang.String type)
Description copied from interface:
MQHeaderFactory.Registry
Returns an MQHeaderFactory that supports the specified header type.
Specified by:
getFactoryForType in interface MQHeaderFactory.Registry
register
- public void register(MQHeaderFactory factory)
Description copied from interface:
MQHeaderFactory.Registry
Registers an MQHeaderFactory.
Specified by:
register in interface MQHeaderFactory.Registry
register
- public void register(java.lang.String format,
- java.lang.String type,
- java.lang.Class headerClass)
Registers a new header type associated with a particular format. The header class must
implement MQHeader. If multiple registrations with the same format or type are made, the last
one wins.
register
- public void register(java.lang.String format,
- java.lang.String type,
- java.lang.String className)
- throws java.lang.ClassNotFoundException
Registers a new header type associated with a particular format. The named class must implement
MQHeader. If multiple registrations with the same format or type are made, the last one wins.
Parameters:
className - the name of the class which implements the header. Throws:
java.lang.ClassNotFoundExceptiongetRegisteredFormats
- public java.util.Collection getRegisteredFormats( )
Returns the set of formats registered in this registry instance.
Specified by:
getRegisteredFormats in interface MQHeaderFactory.Registry
getRegisteredTypes
- public java.util.Collection getRegisteredTypes( )
Returns the set of header types supported by this registry instance.
Specified by:
getRegisteredTypes in interface MQHeaderFactory.Registry
createIterator
- public MQHeaderIterator createIterator( java.io.DataInput message)
Returns an MQHeaderIterator capable of decoding messages of formats known to this registry.
Parameters:
message - the message. createIterator
- public MQHeaderIterator createIterator( java.io.DataInput message,
- java.lang.String format,
- int encoding,
- int characterSet)
Returns an MQHeaderIterator capable of decoding messages of formats known to this registry.
Parameters:
message - the message. encoding - the numeric encoding. see (CMQC.MQENC_* for values). characterSet - the Coded Character Set Identifier. toString
- public java.lang.String toString( )
Returns the string representation of the class instance
Overrides:
toString in class java.lang.Object
Returns:
The string representation
See Also:
Object.toString()