uk.ac.ic.doc.automed.p2p.util.logging
Class LogThread

java.lang.Object
  extended by uk.ac.ic.doc.automed.p2p.util.logging.LogThread

public class LogThread
extends java.lang.Object


Field Summary
static int BOTH
           
static int CLIENT
           
private  AutoMedDHTImpl dht
           
private  JobHandler inHandler
           
private  Queue inQueue
           
private static LogThread instance
           
private static QPlannerLogTree log
           
private static int NUM_IN_QUEUE_WORKERS
           
private static int NUM_OUT_QUEUE_WORKERS
           
private  JobHandler outHandler
           
private  Queue outQueue
           
private  ProcessNode previousNode
           
static int SERVER
           
private  int type
           
 
Constructor Summary
private LogThread(AutoMedDHTImpl peer, int type)
           
 
Method Summary
private  void _receive(Job job)
           
private  void _send(Job job)
          actually send the job to the remote peer
private  boolean canReceive()
           
private  boolean canSend()
           
static LogThread getInstance()
          This method is called when we are sure that an instance has been initialised
static LogThread getInstance(AutoMedDHTImpl peer, int type)
          This method should be called to initialise the first instance
static QPlannerLogTree getLogModel()
           
 void receive(ProcessNode node)
           
 void submit(ProcessNode node, java.lang.String targetPeer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static LogThread instance

log

private static QPlannerLogTree log

inHandler

private JobHandler inHandler

outHandler

private JobHandler outHandler

outQueue

private Queue outQueue

inQueue

private Queue inQueue

previousNode

private ProcessNode previousNode

type

private int type

dht

private AutoMedDHTImpl dht

NUM_IN_QUEUE_WORKERS

private static final int NUM_IN_QUEUE_WORKERS
See Also:
Constant Field Values

NUM_OUT_QUEUE_WORKERS

private static final int NUM_OUT_QUEUE_WORKERS
See Also:
Constant Field Values

CLIENT

public static final int CLIENT
See Also:
Constant Field Values

SERVER

public static final int SERVER
See Also:
Constant Field Values

BOTH

public static final int BOTH
See Also:
Constant Field Values
Constructor Detail

LogThread

private LogThread(AutoMedDHTImpl peer,
                  int type)
Method Detail

getLogModel

public static final QPlannerLogTree getLogModel()

getInstance

public static final LogThread getInstance(AutoMedDHTImpl peer,
                                          int type)
This method should be called to initialise the first instance

Parameters:
peer -
type -
Returns:

getInstance

public static LogThread getInstance()
This method is called when we are sure that an instance has been initialised

Returns:

submit

public void submit(ProcessNode node,
                   java.lang.String targetPeer)

_send

private void _send(Job job)
actually send the job to the remote peer

Parameters:
job -

receive

public void receive(ProcessNode node)

_receive

private void _receive(Job job)

canSend

private boolean canSend()

canReceive

private boolean canReceive()