Interface ServiceHandler


public interface ServiceHandler
This interface enables a service to respond to newly connected clients. If a class wants to be informed about and/or respond to new requests of a service, then this class should implement this interface and it should be added as a handler to the service.
Author:
christian
  • Method Details

    • handleRequest

      void handleRequest(ServiceEnvironment environment, BufferedReader in, PrintWriter out) throws IOException
      Invoked whenever a client connects to the service.
      Parameters:
      environment - is the registered environment of the service. A handler can use this parameter to, for example, log messages.
      in - is the buffer from which the client's request can be read.
      out - is the buffer where a possible response to the client can be written.
      Throws:
      IOException