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 Detail

      • handleRequest

        void handleRequest​(ServiceEnvironment environment,
                           java.io.BufferedReader in,
                           java.io.PrintWriter out)
                    throws java.io.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:
        java.io.IOException