Package org.jgroups.protocols
Class JMS.JMSAddress
- java.lang.Object
-
- org.jgroups.protocols.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
SimpleAddressrepresenting 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.Objectclone()Clone the object.intcompareTo(java.lang.Object o)Compare this object too.booleanequals(java.lang.Object obj)Test is this object is equal toobj.java.lang.StringgetAddress()Get the node address.inthashCode()Get the hash code of this address.booleanisMulticastAddress()Is the address a multicast address?voidreadExternal(java.io.ObjectInput in)Read object from external input.voidreadFrom(java.io.DataInputStream instream)Read the state of the current object (including superclasses) from instream Note that the input stream must not be closedvoidsetAddress(java.lang.String address)Set the node address.intsize()Returns serialized size of this addressjava.lang.StringtoString()Get the string representation of the address.voidwriteExternal(java.io.ObjectOutput out)Write the object to external output.voidwriteTo(java.io.DataOutputStream outstream)Write the entire state of the current object (including superclasses) to outstream.
-
-
-
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:
isMulticastAddressin interfaceAddress- Returns:
trueif the address is multicast address.
-
size
public int size()
Description copied from interface:AddressReturns serialized size of this address
-
clone
protected java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionClone the object.- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
compareTo
public int compareTo(java.lang.Object o) throws java.lang.ClassCastExceptionCompare this object too. It is possible to compare only addresses of the same class. Also they both should be either multicast or unicast addresses.- Specified by:
compareToin interfacejava.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 toobj.- Overrides:
equalsin classjava.lang.Object- Returns:
trueiff theobjisJMSAddress, 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:
hashCodein classjava.lang.Object- Returns:
- hash code of this object.
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundExceptionRead object from external input.- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
toString
public java.lang.String toString()
Get the string representation of the address. The following property holds:a2.equals(a1)is alwaystrue, wherea2isJMSAddress a2 = new JMSAddress(a1.toString());- Overrides:
toStringin classjava.lang.Object- Returns:
- string representation of the address.
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOExceptionWrite the object to external output.- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
writeTo
public void writeTo(java.io.DataOutputStream outstream) throws java.io.IOExceptionDescription copied from interface:StreamableWrite the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed- Specified by:
writeToin interfaceStreamable- Throws:
java.io.IOException
-
readFrom
public void readFrom(java.io.DataInputStream instream) throws java.io.IOException, java.lang.IllegalAccessException, java.lang.InstantiationExceptionDescription copied from interface:StreamableRead the state of the current object (including superclasses) from instream Note that the input stream must not be closed- Specified by:
readFromin interfaceStreamable- Throws:
java.io.IOExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationException
-
-