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
SimpleAddress
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 too
.boolean
equals(java.lang.Object obj)
Test is this object is equal toobj
.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 closedvoid
setAddress(java.lang.String address)
Set the node address.int
size()
Returns serialized size of this addressjava.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.
-
-
-
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 interfaceAddress
- Returns:
true
if the address is multicast address.
-
size
public int size()
Description copied from interface:Address
Returns serialized size of this address
-
clone
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
Clone the object.- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
compareTo
public int compareTo(java.lang.Object o) throws java.lang.ClassCastException
Compare 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:
compareTo
in 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:
equals
in classjava.lang.Object
- Returns:
true
iff theobj
isJMSAddress
, 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 classjava.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 interfacejava.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 alwaystrue
, wherea2
isJMSAddress a2 = new JMSAddress(a1.toString());
- Overrides:
toString
in classjava.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 interfacejava.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 interfaceStreamable
- 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 interfaceStreamable
- Throws:
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationException
-
-