org.jgroups.protocols
Class JMS.JMSAddress
java.lang.Object
org.jgroups.protocols.JMS.JMSAddress
- JMS
- Address, Cloneable, Comparable, Externalizable
protected static class JMS.JMSAddress
extends java.lang.Object
Simple
Address
representing the JMS node ID or JMS topic group.
JMSAddress() - Empty constructor to allow externalization work.
|
JMSAddress(String str) - Reconstruct the address from the string representation.
|
JMSAddress(String address, boolean isMCast) - Create instance of this class for given address string.
|
protected Object | clone() - Clone the object.
|
int | compareTo(Object o) - Compare this object to
o .
|
boolean | equals(Object obj) - Test is this object is equal to
obj .
|
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(ObjectInput in) - Read object from external input.
|
void | setAddress(String address) - Set the node address.
|
String | toString() - Get the string representation of the address.
|
void | writeExternal(ObjectOutput out) - Write the object to external output.
|
JMSAddress
public JMSAddress()
Empty constructor to allow externalization work.
JMSAddress
public JMSAddress(String str)
Reconstruct the address from the string representation. If the
str
starts with '#'
, address is considered
as unicast, and node address is the substring after '#'
.
Otherwise, address is multicast and address is str
itself.
str
- string used to reconstruct the instance.
JMSAddress
public JMSAddress(String address,
boolean isMCast)
Create instance of this class for given address string.
Current implementation uses a hash mark
'#'
to determine
if the address is a unicast or multicast. Therefore, this character is
considered as reserved and is not allowed in the
address
parameter passed to the
JMSAddress(String,boolean)
constructor.
address
- string representing the address of the node connected
to the JMS topic, usually, a value of
connection.getClientID()
, where the connection is
instance of javax.jms.TopicConnection
.isMCast
- true
if the address is multicast address,
otherwise - false
.
clone
protected Object clone()
throws CloneNotSupportedException
Clone the object.
compareTo
public int compareTo(Object o)
throws 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.
- value compliant with the
Comparable.compareTo(Object)
specififaction.
equals
public boolean equals(Object obj)
Test is this object is equal to obj
.
true
iff the obj
is
JMSAddress
, node addresses are equal and they both are
either multicast or unicast addresses.
getAddress
public String getAddress()
- node address in the form passed to the constructor
hashCode
public int hashCode()
Get the hash code of this address.
- hash code of this object.
isMulticastAddress
public boolean isMulticastAddress()
Is the address a multicast address?
- isMulticastAddress in interface Address
true
if the address is multicast address.
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
Read object from external input.
setAddress
public void setAddress(String address)
Set the node address.
address
- new node address.
toString
public 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());
- string representation of the address.
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException
Write the object to external output.
Copyright B) 2001,2002 www.jgroups.com . All Rights Reserved.