org.jgroups.protocols

Class JMS.JMSAddress

Enclosing Class:
JMS
Implemented Interfaces:
Address, Cloneable, Comparable, Externalizable, Streamable

protected static class JMS.JMSAddress
extends java.lang.Object
implements Address

Simple Address representing the JMS node ID or JMS topic group.

Method Summary

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
readFrom(DataInputStream instream)
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed
void
setAddress(String address)
Set the node address.
int
size()
String
toString()
Get the string representation of the address.
void
writeExternal(ObjectOutput out)
Write the object to external output.
void
writeTo(DataOutputStream outstream)
Write the entire state of the current object (including superclasses) to outstream.

Method Details

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.
Returns:
value compliant with the Comparable.compareTo(Object) specififaction.

equals

public boolean equals(Object obj)
Test is this object is equal to obj.
Returns:
true iff the obj is JMSAddress, node addresses are equal and they both are either multicast or unicast addresses.

getAddress

public String getAddress()
Get the node address.
Returns:
node address in the form passed to the constructor JMS.JMSAddress(String, boolean).

hashCode

public int hashCode()
Get the hash code of this address.
Returns:
hash code of this object.

isMulticastAddress

public boolean isMulticastAddress()
Is the address a multicast address?
Specified by:
isMulticastAddress in interface Address
Returns:
true if the address is multicast address.

readExternal

public void readExternal(ObjectInput in)
            throws IOException,
                   ClassNotFoundException
Read object from external input.

readFrom

public void readFrom(DataInputStream instream)
            throws IOException,
                   IllegalAccessException,
                   InstantiationException
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed
Specified by:
readFrom in interface Streamable

setAddress

public void setAddress(String address)
Set the node address.
Parameters:
address - new node address.

size

public int size()
Specified by:
size in interface 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());
Returns:
string representation of the address.

writeExternal

public void writeExternal(ObjectOutput out)
            throws IOException
Write the object to external output.

writeTo

public void writeTo(DataOutputStream outstream)
            throws IOException
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 interface Streamable

Copyright B) 1998-2005 Bela Ban. All Rights Reserved.