buscas
Class ClientHandlerThread

java.lang.Object
  extended by java.lang.Thread
      extended by buscas.ClientHandlerThread
All Implemented Interfaces:
SearchOwner, java.lang.Runnable

public class ClientHandlerThread
extends java.lang.Thread
implements SearchOwner

Entidade responsavel por receber e tratar o pedidos dos varios clientes.

Author:
Knitter

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ClientHandlerThread(Server playground, java.net.ServerSocket conn, java.lang.String ipSecuritas, int portoSecuritas)
          Construtor que permite iniciar os valores a serem usados pela execucao da thread
 
Method Summary
 void result(java.io.File result)
          Implementacao dos metodos da interface SearchOwner.
 void run()
          Metodo a execuar pela thread.
 void searchFinished()
          Implementacao dos metodos da interface SearchOwner.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientHandlerThread

public ClientHandlerThread(Server playground,
                           java.net.ServerSocket conn,
                           java.lang.String ipSecuritas,
                           int portoSecuritas)
Construtor que permite iniciar os valores a serem usados pela execucao da thread

Parameters:
playground - Servidor onde esta thread se encontra a correr.
conn - Socket de servidor onde serao esperadas ligacoes a tratar.
ipSecuritas - IP do servico Securitas.
portoSecuritas - Porto do servico Securitas.
Throws:
bud.exceptions.ClientWithoutServerException - Caso o servidor passado seja nulo.
Method Detail

run

public void run()
Metodo a execuar pela thread.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

result

public void result(java.io.File result)
Implementacao dos metodos da interface SearchOwner.

Specified by:
result in interface SearchOwner
Parameters:
result - Uma abstracao que representa o ficheiro encontrado

searchFinished

public void searchFinished()
                    throws bud.exceptions.NullOutputStreamException
Implementacao dos metodos da interface SearchOwner.

Specified by:
searchFinished in interface SearchOwner
Throws:
bud.exceptions.NullOutputStreamException - Se a stream de escrita nao for valida.
See Also:
SearchOwner