edu.jas.util
Class DistHashTableServer<K>
- java.lang.Object
-
- java.lang.Thread
-
- edu.jas.util.DistHashTableServer<K>
-
- All Implemented Interfaces:
- java.lang.Runnable
public class DistHashTableServer<K> extends java.lang.ThreadServer for the distributed version of a list.
-
-
Field Summary
Fields Modifier and Type Field and Description static intDEFAULT_PORT
-
Constructor Summary
Constructors Constructor and Description DistHashTableServer()Constructs a new DistHashTableServer.DistHashTableServer(ChannelFactory cf)DistHashTableServer.DistHashTableServer(int port)DistHashTableServer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidinit()thread initialization and start.static voidmain(java.lang.String[] args)main.voidrun()main server method.intsize()number of servers.voidterminate()terminate all servers.java.lang.StringtoString()toString.-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
-
-
-
-
Field Detail
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
main
public static void main(java.lang.String[] args) throws java.lang.InterruptedExceptionmain. Usage: DistHashTableServer <port>- Throws:
java.lang.InterruptedException
-
init
public void init()
thread initialization and start.
-
run
public void run()
main server method.- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
terminate
public void terminate()
terminate all servers.
-
size
public int size()
number of servers.
-
toString
public java.lang.String toString()
toString.- Overrides:
toStringin classjava.lang.Thread- Returns:
- a string representation of this.
-
-
DMelt 3.0 © DataMelt by jWork.ORG