it.unimi.di.mg4j.index.remote
Class ServerThread

java.lang.Object
  extended by it.unimi.di.mg4j.index.remote.ServerThread
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
RemoteIndexReader.ServerThread, RemoteInputStream.ServerThread, RemoteOffsetList.ServerThread, RemotePrefixMap.ServerThread, RemoteSizeList.ServerThread, RemoteTermMap.ServerThread

public abstract class ServerThread
extends Object
implements Runnable

A abstract class representing a thread that provides services inside an index server.

Implementing subclasses must just implement the Runnable.run() method, using the predefined socket input stream and socket output stream.

Author:
Sebastiano Vigna

Field Summary
protected  DataInputStream inputStream
          The input stream of socket, buffered and wrapped inside a data input stream.
protected  DataOutputStream outputStream
          The output stream of socket, buffered and wrapped inside a data output stream.
protected  Socket socket
          The socket associated with this server thread.
 
Constructor Summary
ServerThread(Socket socket)
          Creates a new server thread.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Field Detail

socket

protected final Socket socket
The socket associated with this server thread.


inputStream

protected final DataInputStream inputStream
The input stream of socket, buffered and wrapped inside a data input stream.


outputStream

protected final DataOutputStream outputStream
The output stream of socket, buffered and wrapped inside a data output stream.

Constructor Detail

ServerThread

public ServerThread(Socket socket)
             throws IOException
Creates a new server thread.

Parameters:
socket - a socket in listening mode that handles client connections.
Throws:
IOException