org.kth.dks.dks_comm
Class ConnectionManager

java.lang.Object
  extended by org.kth.dks.dks_comm.ConnectionManager

public class ConnectionManager
extends java.lang.Object


Method Summary
 void end()
           
 java.util.Collection getAllNodes()
           
 CommunicationInfo getComInfo()
           
 ConnectionHandler getConnHandler()
          Returns the sole connection handler registered with this instance of the ConnectionManager
 DKSMarshal getDKSMarshal()
           
 java.lang.String getHostAddress()
          Returns the hostname of the current ConnectionManager
static ConnectionManager getInstance(int port)
          Returns the sole instance of this class, port 0 will bind to any port (use getLocalPort() to find out which);
static ConnectionManager getInstanceMultiHome(int port, java.net.InetAddress bindAddr)
          Returns the sole instance of this class, port 0 will bind to any port (use getLocalPort() to find out which);
 int getLocalPort()
          Returns the local port that this communication layer is actually listening to!
 double getNodeRTT(DKSRef node)
           
 WebServer getWebServer()
           
static ConnectionManager newInstance(int port)
          This static factory method is provided for backwards compatibility, and for testing purposes.
 void register(java.lang.Object obj)
           
 void registerDKSNode(DKSRef _dksRef, DKSNode node)
           
 boolean send(MsgSrcDestWrapper triple)
           
 void unregisterDKSNode(DKSRef _dksRef)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static ConnectionManager newInstance(int port)
                                     throws java.io.IOException
This static factory method is provided for backwards compatibility, and for testing purposes. In practise, getInstance() should be used. port 0 will bind to any port (use getLocalPort() to find out which)

Parameters:
port - int port number to run on
Returns:
ConnectionManager a new instance of a ConnectionManager
Throws:
java.io.IOException

getConnHandler

public ConnectionHandler getConnHandler()
Returns the sole connection handler registered with this instance of the ConnectionManager

Returns:
ConnectionHandler

getInstance

public static ConnectionManager getInstance(int port)
                                     throws java.io.IOException
Returns the sole instance of this class, port 0 will bind to any port (use getLocalPort() to find out which);

Returns:
ConnectionManager
Throws:
java.io.IOException

getInstanceMultiHome

public static ConnectionManager getInstanceMultiHome(int port,
                                                     java.net.InetAddress bindAddr)
                                              throws java.io.IOException
Returns the sole instance of this class, port 0 will bind to any port (use getLocalPort() to find out which);

Returns:
ConnectionManager
Throws:
java.io.IOException

getLocalPort

public int getLocalPort()
Returns the local port that this communication layer is actually listening to!

Returns:
int port number

getHostAddress

public java.lang.String getHostAddress()
Returns the hostname of the current ConnectionManager

Returns:
String

registerDKSNode

public void registerDKSNode(DKSRef _dksRef,
                            DKSNode node)
                     throws DKSNodeAlreadyRegistered
Throws:
DKSNodeAlreadyRegistered

unregisterDKSNode

public void unregisterDKSNode(DKSRef _dksRef)

getAllNodes

public java.util.Collection getAllNodes()

send

public boolean send(MsgSrcDestWrapper triple)

register

public void register(java.lang.Object obj)

getDKSMarshal

public DKSMarshal getDKSMarshal()

end

public void end()

getComInfo

public CommunicationInfo getComInfo()

getNodeRTT

public double getNodeRTT(DKSRef node)

getWebServer

public WebServer getWebServer()


Copyright © 2010. All Rights Reserved.