Interface ServerRunner<T extends Client>

All Superinterfaces:
ContextAware, Runnable
All Known Implementing Classes:

public interface ServerRunner<T extends Client> extends ContextAware, Runnable
An object that is responsible for the asynchronous execution of a socket server.

This interface exists primarily to allow the runner to be mocked for the purpose of unit testing the socket server implementation.

Carl Harris
  • Method Details

    • isRunning

      boolean isRunning()
      Gets a flag indicating whether the server is currently running.
      flag state
    • stop

      void stop() throws IOException
      Stops execution of the runner.

      This method must cause all I/O and thread resources associated with the runner to be released. If the receiver has not been started, this method must have no effect.

    • accept

      void accept(ClientVisitor<T> visitor)
      Presents each connected client to the given visitor.
      visitor - the subject visitor