mam.internetworking
Class SocketDaemon

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--mam.internetworking.SocketDaemon

public class SocketDaemon
extends Thread
implements SocketSenderListener


Field Summary
 (package private) static CategoryLog
           
 (package private) InetAddressm_address
           
 (package private) byte[]m_buffer
           
 private URLm_localUrl
           
 (package private) intm_port
           
 (package private) booleanm_quit
           
 (package private) RoutingTablem_routingTable
           
 (package private) ServerSocketm_serverSocket
           

Fields inherited from class java.lang.Thread
MIN_PRIORITY, NORM_PRIORITY, MAX_PRIORITY

Constructor Summary
SocketDaemon(URL localUrl, int port, InetAddress localAddress, RoutingTable routingTable)
           

Method Summary
 protected InetAddressgetAddress()
           
 protected URLgetLocalUrl()
           
 protected intgetPort()
           
 protected RoutingTablegetRoutingTable()
           
 protected voidhandleRoutesQuery(RoutesQueryMessage queryMessage)
           
 protected voidhandleRoutesUpdate(RoutesUpdateMessage updateMessage)
           
 voidhandleSocketSenderEvent(SocketSenderEvent event)
           
 protected voidhandleWrappedObjectMessage(WrappedObjectMessage wrappedObjectMessage)
           
 synchronized voidprocess(Socket socket)
           
 (package private) voidprocessRoutableMessage(RoutableMessage routableMessage)
           
 voidrun()
           
 protected voidsendMessage(URL destinationUrl, RoutableMessage message)
           
 protected voidsetRoutingTable(RoutingTable routingTable)
           
 voidsignalQuit()
           
 StringtoDebugString()
           

Methods inherited from class java.lang.Thread
currentThread, yield, sleep, sleep, start, stop, stop, interrupt, interrupted, isInterrupted, destroy, isAlive, suspend, resume, setPriority, getPriority, setName, getName, getThreadGroup, activeCount, enumerate, countStackFrames, join, join, join, dumpStack, setDaemon, isDaemon, checkAccess, toString, getContextClassLoader, setContextClassLoader

Methods inherited from class java.lang.Object
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize

Field Detail

Log

static Category Log

m_address

InetAddress m_address

m_buffer

byte[] m_buffer

m_localUrl

private URL m_localUrl

m_port

int m_port

m_quit

boolean m_quit

m_routingTable

RoutingTable m_routingTable

m_serverSocket

ServerSocket m_serverSocket
Constructor Detail

SocketDaemon

public SocketDaemon(URL localUrl, int port, InetAddress localAddress, RoutingTable routingTable)
throws java.io.IOException,
java.lang.SecurityException
Method Detail

getAddress

protected InetAddress getAddress()

getLocalUrl

protected URL getLocalUrl()

getPort

protected int getPort()

getRoutingTable

protected RoutingTable getRoutingTable()

handleRoutesQuery

protected void handleRoutesQuery(RoutesQueryMessage queryMessage)

handleRoutesUpdate

protected void handleRoutesUpdate(RoutesUpdateMessage updateMessage)

handleSocketSenderEvent

public void handleSocketSenderEvent(SocketSenderEvent event)

handleWrappedObjectMessage

protected void handleWrappedObjectMessage(WrappedObjectMessage wrappedObjectMessage)

process

public synchronized void process(Socket socket)

processRoutableMessage

void processRoutableMessage(RoutableMessage routableMessage)

run

public void run()

sendMessage

protected void sendMessage(URL destinationUrl, RoutableMessage message)

setRoutingTable

protected void setRoutingTable(RoutingTable routingTable)

signalQuit

public void signalQuit()

toDebugString

public String toDebugString()