Package edu.jas.util

Class DistHashTableServer<K>

  • All Implemented Interfaces:
    java.lang.Runnable

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

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected ChannelFactory cf  
      static int DEFAULT_PORT  
      protected java.util.List<edu.jas.util.DHTBroadcaster<K>> servers  
      protected java.util.SortedMap<K,​DHTTransport> theList  
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void init()
      thread initialization and start.
      static void main​(java.lang.String[] args)
      main.
      void run()
      main server method.
      int size()
      number of servers.
      void terminate()
      terminate all servers.
      java.lang.String toString()
      toString.
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • main

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

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

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

        public void terminate()
        terminate all servers.
      • size

        public int size()
        number of servers.
      • toString

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