Package org.jgroups.protocols
Class JMS.JMSAddress
java.lang.Object
org.jgroups.protocols.JMS.JMSAddress
- All Implemented Interfaces:
Externalizable
,Serializable
,Cloneable
,Comparable
,Address
,Streamable
- Enclosing class:
JMS
Simple
Address
representing the JMS node ID or JMS topic group.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
clone()
Clone the object.int
Compare this object too
.boolean
Test is this object is equal toobj
.Get the node address.int
hashCode()
Get the hash code of this address.boolean
Is the address a multicast address?void
Read object from external input.void
readFrom
(DataInputStream instream) Read the state of the current object (including superclasses) from instream Note that the input stream must not be closedvoid
setAddress
(String address) Set the node address.int
size()
Returns serialized size of this addresstoString()
Get the string representation of the address.void
Write the object to external output.void
writeTo
(DataOutputStream outstream) Write the entire state of the current object (including superclasses) to outstream.
-
Constructor Details
-
JMSAddress
public JMSAddress()Empty constructor to allow externalization work.
-
-
Method Details
-
getAddress
Get the node address.- Returns:
- node address in the form passed to the constructor
invalid @link
{@link #JMS.JMSAddress(String, boolean)
-
setAddress
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
Clone the object.- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
compareTo
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 interfaceComparable
- Returns:
- value compliant with the
Comparable.compareTo(Object)
specififaction. - Throws:
ClassCastException
-
equals
Test is this object is equal toobj
. -
hashCode
public int hashCode()Get the hash code of this address. -
readExternal
Read object from external input.- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
toString
Get the string representation of the address. The following property holds:a2.equals(a1)
is alwaystrue
, wherea2
isJMSAddress a2 = new JMSAddress(a1.toString());
-
writeExternal
Write the object to external output.- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
writeTo
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:
IOException
-
readFrom
public void readFrom(DataInputStream instream) throws IOException, IllegalAccessException, 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:
IOException
IllegalAccessException
InstantiationException
-