SOMA.network.connection
Class ConnectionServer

java.lang.Object
  extended bySOMA.network.connection.ConnectionServer
All Implemented Interfaces:
Daemon, java.lang.Runnable
Direct Known Subclasses:
SSLConnectionServer

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

Server in attesa di connessioni.

Author:
Livio Profiri
See Also:
NewServerExplorerItem

Nested Class Summary
static class ConnectionServer.ConnectionServerException
          Eccezione lanciata da ConnectionServer.
 
Field Summary
(package private)  int backlog
           
(package private)  java.lang.String ErrorDescription
           
(package private)  ConnectionFactory myConnectionFactory
           
(package private)  java.lang.Thread myServerDaemon
           
(package private)  java.net.ServerSocket myServerSocket
           
(package private)  int port
           
(package private)  java.lang.Object status
           
 
Fields inherited from interface SOMA.network.connection.Daemon
ERROR, OFF, ON
 
Constructor Summary
ConnectionServer(int port, int backlog, ConnectionFactory myConnectionFactory)
          Costruttore.
 
Method Summary
 java.lang.Object 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
 

Field Detail

myServerDaemon

java.lang.Thread myServerDaemon

myServerSocket

java.net.ServerSocket myServerSocket

myConnectionFactory

ConnectionFactory myConnectionFactory

status

java.lang.Object status

ErrorDescription

java.lang.String ErrorDescription

port

int port

backlog

int backlog
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 java.lang.Object 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
Throws:
java.io.IOException
ConnectionServer.ConnectionServerException

stop

public void stop()
          throws java.io.IOException,
                 ConnectionServer.ConnectionServerException
Arresta il server.

Specified by:
stop in interface Daemon
Throws:
java.io.IOException
ConnectionServer.ConnectionServerException

toString

public java.lang.String toString()

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


Copyright © 2004 Luca Foschini