Class MQRoot

java.lang.Object
com.ibm.mq.jms.MQRoot
All Implemented Interfaces:
JmsPropertyContext, JmsReadablePropertyContext, Serializable, Map<String,Object>
Direct Known Subclasses:
MQConnection, MQConnectionMetaData, MQMessageConsumer, MQMessageProducer, MQQueueBrowser, MQSession

public abstract class MQRoot extends Object implements JmsPropertyContext
This is a root object for all the objects in the package com.ibm.mq.jms; it provides a common point to implement the JmsPropertyContext interface. The IBM JMS Extensions are implemented by the concrete classes in com.ibm.mq.jms, therefore all objects need to implement the property context interface.
See Also:
  • Method Details

    • setBatchProperties

      public void setBatchProperties(Map<String,Object> properties) throws javax.jms.JMSException
      Sets multiple property values passed in via a HashMap.
      Specified by:
      setBatchProperties in interface JmsPropertyContext
      Parameters:
      properties - the HashMap of properties.
      Throws:
      javax.jms.JMSException - if any property is marked read-only or if the proposed value is invalid for any property.
    • setBooleanProperty

      public void setBooleanProperty(String name, boolean value) throws javax.jms.JMSException
      Sets a Boolean property value with the given name.
      Specified by:
      setBooleanProperty in interface JmsPropertyContext
      Parameters:
      name - the name of the Boolean property.
      value - the Boolean property value to set.
      Throws:
      javax.jms.JMSException - if the property is marked read-only or if the proposed value is invalid for the property.
    • setByteProperty

      public void setByteProperty(String name, byte value) throws javax.jms.JMSException
      Sets a byte property value with the given name.
      Specified by:
      setByteProperty in interface JmsPropertyContext
      Parameters:
      name - the name of the byte property.
      value - the byte property value to set.
      Throws:
      javax.jms.JMSException - if the property is marked read-only or if the proposed value is invalid for the property.
    • setBytesProperty

      public void setBytesProperty(String name, byte[] value) throws javax.jms.JMSException
      Sets a bytes property value with the given name.
      Specified by:
      setBytesProperty in interface JmsPropertyContext
      Parameters:
      name - the name of the bytes property.
      value - the bytes property value to set.
      Throws:
      javax.jms.JMSException - if the property is marked read-only or if the proposed value is invalid for the property.
    • setCharProperty

      public void setCharProperty(String name, char value) throws javax.jms.JMSException
      Sets a char property value with the given name.
      Specified by:
      setCharProperty in interface JmsPropertyContext
      Parameters:
      name - the name of the char property.
      value - the char property value to set.
      Throws:
      javax.jms.JMSException - if the property is marked read-only or if the proposed value is invalid for the property.
    • setDoubleProperty

      public void setDoubleProperty(String name, double value) throws javax.jms.JMSException
      Sets a double property value with the given name.
      Specified by:
      setDoubleProperty in interface JmsPropertyContext
      Parameters:
      name - the name of the double property.
      value - the double property value to set.
      Throws:
      javax.jms.JMSException - if the property is marked read-only or if the proposed value is invalid for the property.
    • setFloatProperty

      public void setFloatProperty(String name, float value) throws javax.jms.JMSException
      Sets a float property value with the given name.
      Specified by:
      setFloatProperty in interface JmsPropertyContext
      Parameters:
      name - the name of the float property.
      value - the float property value to set.
      Throws:
      javax.jms.JMSException - if the property is marked read-only or if the proposed value is invalid for the property.
    • setIntProperty

      public void setIntProperty(String name, int value) throws javax.jms.JMSException
      Sets an int property value with the given name.
      Specified by:
      setIntProperty in interface JmsPropertyContext
      Parameters:
      name - the name of the int property.
      value - the int property value to set.
      Throws:
      javax.jms.JMSException - if the property is marked read-only or if the proposed value is invalid for the property.
    • setLongProperty

      public void setLongProperty(String name, long value) throws javax.jms.JMSException
      Sets a long property value with the given name.
      Specified by:
      setLongProperty in interface JmsPropertyContext
      Parameters:
      name - the name of the long property.
      value - the long property value to set.
      Throws:
      javax.jms.JMSException - if the property is marked read-only or if the proposed value is invalid for the property.
    • setObjectProperty

      public void setObjectProperty(String name, Object value) throws javax.jms.JMSException
      Sets an Object property value with the given name.
      Specified by:
      setObjectProperty in interface JmsPropertyContext
      Parameters:
      name - the name of the Object property.
      value - the Object property value to set.
      Throws:
      javax.jms.JMSException - if the property is marked read-only or if the proposed value is invalid for the property.
    • setShortProperty

      public void setShortProperty(String name, short value) throws javax.jms.JMSException
      Sets a short property value with the given name.
      Specified by:
      setShortProperty in interface JmsPropertyContext
      Parameters:
      name - the name of the short property.
      value - the short property value to set.
      Throws:
      javax.jms.JMSException - if the property is marked read-only or if the proposed value is invalid for the property.
    • setStringProperty

      public void setStringProperty(String name, String value) throws javax.jms.JMSException
      Sets a String property value with the given name.
      Specified by:
      setStringProperty in interface JmsPropertyContext
      Parameters:
      name - the name of the String property.
      value - the String property value to set.
      Throws:
      javax.jms.JMSException - if the property is marked read-only or if the proposed value is invalid for the property.
    • getBooleanProperty

      public boolean getBooleanProperty(String name) throws javax.jms.JMSException
      Gets the boolean property value with the given name.
      Specified by:
      getBooleanProperty in interface JmsReadablePropertyContext
      Parameters:
      name - the name of the property to be retrieved.
      Returns:
      the boolean property value with the given name.
      Throws:
      javax.jms.JMSException - if the value of the property is null or if the value can not be converted to Boolean type.
    • getByteProperty

      public byte getByteProperty(String name) throws javax.jms.JMSException
      Gets the byte property value with the given name.
      Specified by:
      getByteProperty in interface JmsReadablePropertyContext
      Parameters:
      name - the name of the property to be retrieved.
      Returns:
      the byte property value with the given name.
      Throws:
      javax.jms.JMSException - if the value of the property is null or if the value can not be converted to Byte type.
    • getBytesProperty

      public byte[] getBytesProperty(String name) throws javax.jms.JMSException
      Gets the bytes property value with the given name.
      Specified by:
      getBytesProperty in interface JmsReadablePropertyContext
      Parameters:
      name - the name of the property to be retrieved.
      Returns:
      the bytes property value with the given name.
      Throws:
      javax.jms.JMSException - if the value of the property is null.
    • getCharProperty

      public char getCharProperty(String name) throws javax.jms.JMSException
      Gets the char property value with the given name.
      Specified by:
      getCharProperty in interface JmsReadablePropertyContext
      Parameters:
      name - the name of the property to be retrieved.
      Returns:
      the char property value with the given name.
      Throws:
      javax.jms.JMSException - if the value of the property is null or if the value can not be converted to Character type.
    • getDoubleProperty

      public double getDoubleProperty(String name) throws javax.jms.JMSException
      Gets the double property value with the given name.
      Specified by:
      getDoubleProperty in interface JmsReadablePropertyContext
      Parameters:
      name - the name of the property to be retrieved.
      Returns:
      the double property value with the given name.
      Throws:
      javax.jms.JMSException - if the value of the property is null or if the value can not be converted to Double type.
    • getFloatProperty

      public float getFloatProperty(String name) throws javax.jms.JMSException
      Gets the float property value with the given name.
      Specified by:
      getFloatProperty in interface JmsReadablePropertyContext
      Parameters:
      name - the name of the property to be retrieved.
      Returns:
      the float property value with the given name.
      Throws:
      javax.jms.JMSException - if the value of the property is null or if the value can not be converted to Float type.
    • getIntProperty

      public int getIntProperty(String name) throws javax.jms.JMSException
      Gets the int property value with the given name.
      Specified by:
      getIntProperty in interface JmsReadablePropertyContext
      Parameters:
      name - the name of the property to be retrieved.
      Returns:
      the int property value with the given name.
      Throws:
      javax.jms.JMSException - if the value of the property is null or if the value can not be converted to Integer type.
    • getLongProperty

      public long getLongProperty(String name) throws javax.jms.JMSException
      Gets the long property value with the given name.
      Specified by:
      getLongProperty in interface JmsReadablePropertyContext
      Parameters:
      name - the name of the property to be retrieved.
      Returns:
      the long property value with the given name.
      Throws:
      javax.jms.JMSException - if the value of the property is null or if the value can not be converted to long type.
    • getObjectProperty

      public Object getObjectProperty(String name) throws javax.jms.JMSException
      Gets the Object property value with the given name.
      Specified by:
      getObjectProperty in interface JmsReadablePropertyContext
      Parameters:
      name - the name of the property to be retrieved.
      Returns:
      the Object property value with the given name.
      Throws:
      javax.jms.JMSException - if the value of the property is null.
    • getPropertyNames

      public Enumeration<String> getPropertyNames() throws javax.jms.JMSException
      Gets all properties which have been set on a resource.
      Specified by:
      getPropertyNames in interface JmsReadablePropertyContext
      Returns:
      the Enumeration of all set properties.
      Throws:
      javax.jms.JMSException - if an error occurs while enumerating property names.
    • getShortProperty

      public short getShortProperty(String name) throws javax.jms.JMSException
      Gets the short property value with the given name.
      Specified by:
      getShortProperty in interface JmsReadablePropertyContext
      Parameters:
      name - the name of the property to be retrieved.
      Returns:
      the short property value with the given name.
      Throws:
      javax.jms.JMSException - if the value of the property is null or if the value can not be converted to Short type.
    • getStringProperty

      public String getStringProperty(String name) throws javax.jms.JMSException
      Gets the String property value with the given name.
      Specified by:
      getStringProperty in interface JmsReadablePropertyContext
      Parameters:
      name - the name of the property to be retrieved.
      Returns:
      the String property value with the given name.
      Throws:
      javax.jms.JMSException - if the value of the property is null or if the value can not be converted to String type.
    • propertyExists

      public boolean propertyExists(String name) throws javax.jms.JMSException
      Indicates whether a named property exists.
      Specified by:
      propertyExists in interface JmsReadablePropertyContext
      Parameters:
      name - the name of the property to be retrieved.
      Returns:
      true if the property exists, false if it does not.
      Throws:
      javax.jms.JMSException - if the name of the property is null.
    • clear

      public void clear()
      Clears all properties
      Specified by:
      clear in interface Map<String,Object>
      See Also:
    • containsKey

      public boolean containsKey(Object key)
      Ascertains whether the specified key exists in the properties map
      Specified by:
      containsKey in interface Map<String,Object>
      Parameters:
      key - key to check
      Returns:
      boolean to indicate if the key exists
      See Also:
    • containsValue

      public boolean containsValue(Object value)
      Ascertains whether the specified value exists in the properties map
      Specified by:
      containsValue in interface Map<String,Object>
      Parameters:
      value - value to check
      Returns:
      boolean to indicate if the value exists
      See Also:
    • entrySet

      public Set<Map.Entry<String,Object>> entrySet()
      The entry set of the properties map
      Specified by:
      entrySet in interface Map<String,Object>
      Returns:
      the entry set
      See Also:
    • get

      public Object get(Object key)
      Gets the property associated with the specified key
      Specified by:
      get in interface Map<String,Object>
      Returns:
      the object
      See Also:
    • isEmpty

      public boolean isEmpty()
      Indicates whether the properties map is empty
      Specified by:
      isEmpty in interface Map<String,Object>
      Returns:
      true if the map is empty
      See Also:
    • keySet

      public Set<String> keySet()
      Gets a Set of the property keys in the property map
      Specified by:
      keySet in interface Map<String,Object>
      Returns:
      the Set of property keys
      See Also:
    • put

      public Object put(String key, Object value)
      Adds the specified key and value to the properties map
      Specified by:
      put in interface Map<String,Object>
      Parameters:
      key - the key associated with the property
      value - the property value
      See Also:
    • putAll

      public void putAll(Map<? extends String,? extends Object> properties)
      Adds the properties in the specified map to the properties map
      Specified by:
      putAll in interface Map<String,Object>
      Parameters:
      properties - the map of properties to set
      See Also:
    • remove

      public Object remove(Object key)
      Removes the property associated with the specified key from the properties map.
      Specified by:
      remove in interface Map<String,Object>
      Parameters:
      key - the key associated with the property being removed
      See Also:
    • size

      public int size()
      Gets the number of properties in the properties map.
      Specified by:
      size in interface Map<String,Object>
      Returns:
      the number of properties
      See Also:
    • values

      public Collection<Object> values()
      Gets the values of properties in the properties map.
      Specified by:
      values in interface Map<String,Object>
      Returns:
      a collection of the property values
      See Also:
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Map<String,Object>
      Overrides:
      equals in class Object
      See Also:
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map<String,Object>
      Overrides:
      hashCode in class Object
      See Also: