ittp
Class Server

java.lang.Object
  extended byjava.lang.Thread
      extended byittp.Server
All Implemented Interfaces:
java.lang.Runnable

public class Server
extends java.lang.Thread

The main entry to the ITTP Server Create the different a new socket for each request from a new client.

Version:
1.3
Author:
Frederic Bidon and Mathieu Texier
See Also:
Control

Field Summary
(package private)  java.lang.ThreadGroup threadGroup
          the whole connect thread
static double VERSION
          Current version of the server
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
static Server getInstance()
          Accesor for the one and only one server instance
static java.net.InetAddress getIP()
          Accesor for the one and only one server instance
static Parameters getParameters()
          accessor to the object parameter
static void logInfo(java.io.PrintStream std, java.lang.String message)
          Redirect the different messages generated during the execution of the different thread to different file according to if we have an error's message or an information's message.
static void main(java.lang.String[] args)
          The main method of the server.
 void run()
          Accepts new client connections.
static void usage()
          Method explaining to the user the operating of the several options.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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

VERSION

public static final double VERSION
Current version of the server

See Also:
Constant Field Values

threadGroup

java.lang.ThreadGroup threadGroup
the whole connect thread

Method Detail

getParameters

public static Parameters getParameters()
accessor to the object parameter

Returns:
the object paramters that contains the different parameters of the server.

getInstance

public static Server getInstance()
Accesor for the one and only one server instance

Returns:
the object server.

getIP

public static java.net.InetAddress getIP()
Accesor for the one and only one server instance

Returns:
the object server.

usage

public static void usage()
Method explaining to the user the operating of the several options.


main

public static void main(java.lang.String[] args)
The main method of the server. Check and initialize a new port's number or a new base directory if it are precised in parameters. Starts a new ITTP Server listening on the specified port.

Parameters:
args - the command line arguments

run

public void run()
Accepts new client connections. This method is called by a new thread when the superclass call the start() method.


logInfo

public static void logInfo(java.io.PrintStream std,
                           java.lang.String message)
Redirect the different messages generated during the execution of the different thread to different file according to if we have an error's message or an information's message.

Parameters:
message - String containing the error message denerated by the server.
std - Stream into witch the message is written