org.apache.geronimo.messaging
Class NodeInfo

java.lang.Object
  extended byorg.apache.geronimo.messaging.NodeInfo
All Implemented Interfaces:
Externalizable, Serializable

public class NodeInfo
extends Object
implements Externalizable

Wraps the properties of a Node.
It identifies a Node uniquely on the network.
Such an instance could be wrapped in a packet and sent to a multicast group. Other Nodes belonging to this group could then decide to join it or not.

Version:
$Revision: 1.1 $ $Date: 2004/05/11 12:06:41 $
See Also:
Serialized Form

Constructor Summary
NodeInfo()
          Required for Externalization.
NodeInfo(String aName, InetAddress anAddess, int aPort)
          Creates a NodeInfo defining uniquely a node on a network.
 
Method Summary
 boolean equals(Object obj)
           
 InetAddress getAddress()
          Gets the listening address of the node providing this instance.
 String getName()
          Gets the name of the node providing this instance.
 int getPort()
          Gets the listening port of the node providing this instance.
 int hashCode()
           
static NodeInfo[] pop(NodeInfo[] aNodeInfo)
          Pops the first element of the array and returns the resulting array.
 void readExternal(ObjectInput in)
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeInfo

public NodeInfo()
Required for Externalization.


NodeInfo

public NodeInfo(String aName,
                InetAddress anAddess,
                int aPort)
Creates a NodeInfo defining uniquely a node on a network.

Parameters:
aName - Name of the node.
anAddess - Address that the node is listening on.
aPort - Listening port.
Method Detail

pop

public static NodeInfo[] pop(NodeInfo[] aNodeInfo)
Pops the first element of the array and returns the resulting array.

Parameters:
aNodeInfo - Array whose first element is to be popped.
Returns:
New array. If the size of aNodeInfo is one, then null is returned.

getAddress

public InetAddress getAddress()
Gets the listening address of the node providing this instance.

Returns:
Listening address.

getName

public String getName()
Gets the name of the node providing this instance.

Returns:
Node name.

getPort

public int getPort()
Gets the listening port of the node providing this instance.

Returns:
Listening port.

hashCode

public int hashCode()

equals

public boolean equals(Object obj)

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

toString

public String toString()


Copyright © 2003-2005 Apache Software Foundation. All Rights Reserved.