Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

edu.stanford.genetics.treeview.app
Class Daemon  view Daemon download Daemon.java

java.lang.Object
  extended byjava.lang.Thread
      extended byedu.stanford.genetics.treeview.app.Daemon
All Implemented Interfaces:
java.lang.Runnable

public class Daemon
extends java.lang.Thread

A daemon is a thread that waits for request and forward to a RequestHandler in this case, the TreeViewApp The intention of this : If an instance of the program is running, it shall starts a daemon which waits for requests. When another instance of the program is started, the new program will first try to contact the daemons. If any exists, the new program will ask the daemon to do the task. daemon will delegate the task to the RequestHandler.


Nested Class Summary
static interface Daemon.RequestHandler
           
static class Daemon.SimpleClient
           
 
Nested classes inherited from class java.lang.Thread
java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static int BASE_PORT
           
static java.lang.String DAEMON_RUNNING
           
static boolean DEBUG
           
private  Daemon.RequestHandler handler
           
static int NUM_OF_PORTS
           
static int REQUST_TIME_OUT
           
private  java.net.ServerSocket serverSocket
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Daemon(Daemon.RequestHandler handler)
           
 
Method Summary
private  boolean initSocket()
           
 void run()
          The method of Thread that will be run if there is no Runnable object associated with the Thread.
static java.lang.String toString(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DAEMON_RUNNING

public static java.lang.String DAEMON_RUNNING

BASE_PORT

public static int BASE_PORT

NUM_OF_PORTS

public static int NUM_OF_PORTS

REQUST_TIME_OUT

public static int REQUST_TIME_OUT

serverSocket

private java.net.ServerSocket serverSocket

handler

private Daemon.RequestHandler handler

DEBUG

public static boolean DEBUG
Constructor Detail

Daemon

public Daemon(Daemon.RequestHandler handler)
       throws java.io.IOException
Method Detail

initSocket

private boolean initSocket()

run

public void run()
Description copied from class: java.lang.Thread
The method of Thread that will be run if there is no Runnable object associated with the Thread. Thread's implementation does nothing at all.


toString

public static java.lang.String toString(java.lang.String[] args)