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 Objectclone()Clone the object.intCompare this object too.booleanTest is this object is equal toobj.Get the node address.inthashCode()Get the hash code of this address.booleanIs the address a multicast address?voidRead object from external input.voidreadFrom(DataInputStream instream) Read the state of the current object (including superclasses) from instream Note that the input stream must not be closedvoidsetAddress(String address) Set the node address.intsize()Returns serialized size of this addresstoString()Get the string representation of the address.voidWrite the object to external output.voidwriteTo(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:
isMulticastAddressin interfaceAddress- Returns:
trueif the address is multicast address.
-
size
public int size()Description copied from interface:AddressReturns serialized size of this address -
clone
Clone the object.- Overrides:
clonein 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:
compareToin 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:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
toString
Get the string representation of the address. The following property holds:a2.equals(a1)is alwaystrue, wherea2isJMSAddress a2 = new JMSAddress(a1.toString()); -
writeExternal
Write the object to external output.- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
writeTo
Description 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:
IOException
-
readFrom
public void readFrom(DataInputStream instream) throws IOException, IllegalAccessException, InstantiationException Description 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:
IOExceptionIllegalAccessExceptionInstantiationException
-