core
Class SingletonManager

java.lang.Object
  extended byjava.lang.Thread
      extended bycore.SingletonManager
All Implemented Interfaces:
java.lang.Runnable

public class SingletonManager
extends java.lang.Thread

A utility class of which at most one instance can exist per VM. Use Singleton.instance() to access this instance.


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 Buffer findBufferIP(java.lang.String IP)
          NOT USED.
 Socket findSocketIP(java.lang.String IP, int host, java.lang.String src)
          Find and return Socket
 java.lang.String getIPAdd()
          NOT USED ANYMORE as IP's assigned statically.
 Buffer getVnet()
          Return the Buffer which is the Virtual Network
static SingletonManager instance()
           
 void launchapps()
          NOT USED ANYMORE ...
 void launchGuiApps()
          NOTE USED ANYMORE ...!!??!
 void run()
          Start running the Dispatcher.
 void setBuffer(java.lang.String IP, Buffer inBuffer)
          Set input buffer for a node.
 void setServerSockets(java.lang.String IP, java.util.ArrayList serversockets)
          Used to provide the Singelton Manager with a reference to the ServerSockets of a node.
 void setSockets(java.lang.String IP, java.util.ArrayList sockets)
          Used to provide the SingletonManager with a reference to the Sockets of a node.
 void setupServerSocket(java.lang.String IP, int port, Socket sock)
          This method is used to create a connection to a ServerSocket from a client.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

instance

public static SingletonManager instance()
Returns:
The unique instance of this class.

getVnet

public Buffer getVnet()
Return the Buffer which is the Virtual Network

Returns:
Buffer object representing the Virtual Network

setBuffer

public void setBuffer(java.lang.String IP,
                      Buffer inBuffer)
Set input buffer for a node.

Parameters:
IP - IP Address to which the buffer belongs.
inBuffer - The packet input buffer.

setSockets

public void setSockets(java.lang.String IP,
                       java.util.ArrayList sockets)
Used to provide the SingletonManager with a reference to the Sockets of a node.

Parameters:
IP - IP Address which the Sockets belong to.
sockets - ArrayList of Sockets.

setServerSockets

public void setServerSockets(java.lang.String IP,
                             java.util.ArrayList serversockets)
Used to provide the Singelton Manager with a reference to the ServerSockets of a node.

Parameters:
IP - IP Address which the ServerSockets belong to.
serversockets - ArrayList of ServerSockets.

getIPAdd

public java.lang.String getIPAdd()
NOT USED ANYMORE as IP's assigned statically.

Returns:

findBufferIP

public Buffer findBufferIP(java.lang.String IP)
NOT USED.

Parameters:
IP -
Returns:

findSocketIP

public Socket findSocketIP(java.lang.String IP,
                           int host,
                           java.lang.String src)
Find and return Socket

Parameters:
IP - IP Address of the Socket
host - port number to which the Socket is bound at the Server.
src - port number to which the Socket is bound at the Client.
Returns:
Socket.

setupServerSocket

public void setupServerSocket(java.lang.String IP,
                              int port,
                              Socket sock)
                       throws java.io.IOException
This method is used to create a connection to a ServerSocket from a client.

Parameters:
IP - The IP Address of the ServerSocket
port - The port at the IP Address to which the Socket is to be bound.
sock - The Socket wishing to be bound.
Throws:
java.io.IOException

launchapps

public void launchapps()
NOT USED ANYMORE ... DELETE!!?


launchGuiApps

public void launchGuiApps()
NOTE USED ANYMORE ...!!??!


run

public void run()
Start running the Dispatcher.