P2PDirectoryUDPHelper
Keywords: uk.ac.ic.doc.automed.p2p.directory.P2PDirectoryUDPHelper class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## uk.ac.ic.doc.automed.p2p.directory
Class P2PDirectoryUDPHelper

    java.lang.Object
      uk.ac.ic.doc.automed.p2p.directory.P2PDirectoryUDPHelper

All Implemented Interfaces:
  uk.ac.ic.doc.automed.util.queue.JobHandler

    public class P2PDirectoryUDPHelper

extends java.lang.Object
implements uk.ac.ic.doc.automed.util.queue.JobHandler

Constructor Summary
`P2PDirectoryUDPHelper(P2PDirectory directory, int numWorkers)` Creates a new instance of P2PDirectoryUDPHelper

Method Summary
`void` | `handleJob(uk.ac.ic.doc.automed.util.queue.Job job)` Implement `JobHandler` interface. This method is invoked by every job thread to handle UDP requests from clients
`protected void` | `runPeerMonitorProcesses()` Execute two separate background processes for monitoring peers' status: (1) one process runs every hold_time interval to move in-active peers to gabage-collectible (2) another runs every flush_time interval to delete gabage-collectible peers
`protected void` | `runUDPServer()` Create UDP server with loads of worker threads

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

Constructor Detail

### P2PDirectoryUDPHelper

    public P2PDirectoryUDPHelper(P2PDirectory directory,
                                 int numWorkers)

  Creates a new instance of P2PDirectoryUDPHelper

Method Detail

### runUDPServer

    protected void runUDPServer()
                         throws AutoMedException

  Create UDP server with loads of worker threads

  Throws:
    `AutoMedException`

### runPeerMonitorProcesses

    protected void runPeerMonitorProcesses()
                                    throws AutoMedException

  Execute two separate background processes for monitoring peers' status:
  (1) one process runs every hold_time interval to move in-active peers to gabage-collectible (2) another runs every flush_time interval to delete gabage-collectible peers

  Throws:
    `AutoMedException`

### handleJob

    public void handleJob(uk.ac.ic.doc.automed.util.queue.Job job)
                   throws AutoMedException

  Implement `JobHandler` interface.
  This method is invoked by every job thread to handle UDP requests from clients

  Specified by:
    `handleJob` in interface `uk.ac.ic.doc.automed.util.queue.JobHandler`
  Throws:
    `AutoMedException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD