Class JMS.JMSAddress

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, Address, Streamable
    Enclosing class:
    JMS

    public static class JMS.JMSAddress
    extends java.lang.Object
    implements Address
    Simple Address representing the JMS node ID or JMS topic group.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      JMSAddress()
      Empty constructor to allow externalization work.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.Object clone()
      Clone the object.
      int compareTo​(java.lang.Object o)
      Compare this object to o.
      boolean equals​(java.lang.Object obj)
      Test is this object is equal to obj.
      java.lang.String getAddress()
      Get the node address.
      int hashCode()
      Get the hash code of this address.
      boolean isMulticastAddress()
      Is the address a multicast address?
      void readExternal​(java.io.ObjectInput in)
      Read object from external input.
      void readFrom​(java.io.DataInputStream instream)
      Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed
      void setAddress​(java.lang.String address)
      Set the node address.
      int size()
      Returns serialized size of this address
      java.lang.String toString()
      Get the string representation of the address.
      void writeExternal​(java.io.ObjectOutput out)
      Write the object to external output.
      void writeTo​(java.io.DataOutputStream outstream)
      Write the entire state of the current object (including superclasses) to outstream.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • JMSAddress

        public JMSAddress()
        Empty constructor to allow externalization work.
    • Method Detail

      • getAddress

        public java.lang.String getAddress()
        Get the node address.
        Returns:
        node address in the form passed to the constructor {@link #JMS.JMSAddress(String, boolean)}.
      • setAddress

        public void setAddress​(java.lang.String address)
        Set the node address.
        Parameters:
        address - new node address.
      • isMulticastAddress

        public boolean isMulticastAddress()
        Is the address a multicast address?
        Specified by:
        isMulticastAddress in interface Address
        Returns:
        true if the address is multicast address.
      • size

        public int size()
        Description copied from interface: Address
        Returns serialized size of this address
        Specified by:
        size in interface Address
      • clone

        protected java.lang.Object clone()
                                  throws java.lang.CloneNotSupportedException
        Clone the object.
        Overrides:
        clone in class java.lang.Object
        Throws:
        java.lang.CloneNotSupportedException
      • compareTo

        public int compareTo​(java.lang.Object o)
                      throws java.lang.ClassCastException
        Compare this object to o. It is possible to compare only addresses of the same class. Also they both should be either multicast or unicast addresses.
        Specified by:
        compareTo in interface java.lang.Comparable
        Returns:
        value compliant with the Comparable.compareTo(Object) specififaction.
        Throws:
        java.lang.ClassCastException
      • equals

        public boolean equals​(java.lang.Object obj)
        Test is this object is equal to obj.
        Overrides:
        equals in class java.lang.Object
        Returns:
        true iff the obj is JMSAddress, node addresses are equal and they both are either multicast or unicast addresses.
      • hashCode

        public int hashCode()
        Get the hash code of this address.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hash code of this object.
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Read object from external input.
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • toString

        public java.lang.String toString()
        Get the string representation of the address. The following property holds: a2.equals(a1) is always true, where a2 is JMSAddress a2 = new JMSAddress(a1.toString());
        Overrides:
        toString in class java.lang.Object
        Returns:
        string representation of the address.
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Write the object to external output.
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • writeTo

        public void writeTo​(java.io.DataOutputStream outstream)
                     throws java.io.IOException
        Description copied from interface: Streamable
        Write the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed
        Specified by:
        writeTo in interface Streamable
        Throws:
        java.io.IOException
      • readFrom

        public void readFrom​(java.io.DataInputStream instream)
                      throws java.io.IOException,
                             java.lang.IllegalAccessException,
                             java.lang.InstantiationException
        Description copied from interface: Streamable
        Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed
        Specified by:
        readFrom in interface Streamable
        Throws:
        java.io.IOException
        java.lang.IllegalAccessException
        java.lang.InstantiationException