Class DistHashTableServer<K>

java.lang.Object
java.lang.Thread
edu.jas.util.DistHashTableServer<K>
All Implemented Interfaces:
Runnable

public class DistHashTableServer<K> extends Thread
Server for the distributed version of a list. TODO: redistribute list for late coming clients, removal of elements.
Author:
Heinz Kredel
  • Field Details

  • Constructor Details

    • DistHashTableServer

      public DistHashTableServer()
      Constructs a new DistHashTableServer.
    • DistHashTableServer

      public DistHashTableServer(int port)
      DistHashTableServer.
      Parameters:
      port - to run server on.
    • DistHashTableServer

      public DistHashTableServer(ChannelFactory cf)
      DistHashTableServer.
      Parameters:
      cf - ChannelFactory to use.
  • Method Details

    • main

      public static void main(String[] args) throws InterruptedException
      main. Usage: DistHashTableServer <port>
      Throws:
      InterruptedException
    • init

      public void init()
      thread initialization and start.
    • run

      public void run()
      main server method.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • terminate

      public void terminate()
      terminate all servers.
    • size

      public int size()
      number of servers.
    • toString

      public String toString()
      toString.
      Overrides:
      toString in class Thread
      Returns:
      a string representation of this.