Rice Pastry API

org.mpisws.p2p.transport.simpleidentity
Class MutableInetSocketAddressStrategy

java.lang.Object
  extended by org.mpisws.p2p.transport.simpleidentity.MutableInetSocketAddressStrategy
Type Parameters:
InetSocketAddress -
All Implemented Interfaces:
LocalIdentifierStrategy<java.net.InetSocketAddress>

public class MutableInetSocketAddressStrategy
extends java.lang.Object
implements LocalIdentifierStrategy<java.net.InetSocketAddress>

This is used if you are binding to 0.0.0.0 It will see if your local address changed before returning the serialized version.

Author:
Jeff Hoye

Constructor Summary
MutableInetSocketAddressStrategy(int port, Serializer<java.net.InetSocketAddress> serializer)
           
 
Method Summary
protected  java.net.InetAddress getLocalAddress()
          Can be overridden to do something special in the case of having multiple NICs
 byte[] getLocalIdentifierBytes()
           
protected  byte[] serializeAddress(java.net.InetSocketAddress addr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutableInetSocketAddressStrategy

public MutableInetSocketAddressStrategy(int port,
                                        Serializer<java.net.InetSocketAddress> serializer)
Method Detail

getLocalIdentifierBytes

public byte[] getLocalIdentifierBytes()
                               throws java.io.IOException
Specified by:
getLocalIdentifierBytes in interface LocalIdentifierStrategy<java.net.InetSocketAddress>
Throws:
java.io.IOException

serializeAddress

protected byte[] serializeAddress(java.net.InetSocketAddress addr)
                           throws java.io.IOException
Throws:
java.io.IOException

getLocalAddress

protected java.net.InetAddress getLocalAddress()
                                        throws java.io.IOException
Can be overridden to do something special in the case of having multiple NICs

Returns:
the current address to advertise
Throws:
java.io.IOException

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection