SOMA.network.connection
Class ConnectionServer

java.lang.Object
  |
  +--SOMA.network.connection.ConnectionServer

public class ConnectionServer
extends java.lang.Object
implements java.lang.Runnable, Daemon

Server in attesa di connessioni.

Author:
Livio Profiri
See Also:
NewServerExplorerItem

Inner Class Summary
static interface ConnectionServer.ConnectionServerException
          Eccezione lanciata da ConnectionServer.
 
Constructor Summary
ConnectionServer(int port, int backlog, ConnectionFactory myConnectionFactory)
          Costruttore.
 
Method Summary
 int getStatus()
          Restituisce lo stato.
 void run()
          Metodo eseguito dal demone: attende richieste ed attiva connessioni finche' lo stato rimane ON e la ServerSocket attiva.
 void start()
          Avvia il server.
 void stop()
          Arresta il server.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConnectionServer

public ConnectionServer(int port,
                        int backlog,
                        ConnectionFactory myConnectionFactory)
Costruttore.
Parameters:
port - Porta su cui si attendono connessioni.
backlog - Numero massimo di connessioni contemporanee.
myConnectionFactory - Classe responsabile della creazione delle connessioni.
Method Detail

getStatus

public int getStatus()
Restituisce lo stato.
Specified by:
getStatus in interface Daemon

start

public void start()
           throws java.io.IOException,
                  ConnectionServer.ConnectionServerException
Avvia il server.
Specified by:
start in interface Daemon

stop

public void stop()
          throws java.io.IOException,
                 ConnectionServer.ConnectionServerException
Arresta il server.
Specified by:
stop in interface Daemon

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

run

public void run()
Metodo eseguito dal demone: attende richieste ed attiva connessioni finche' lo stato rimane ON e la ServerSocket attiva.
Specified by:
run in interface java.lang.Runnable