Top Description Methods
ch.qos.logback.core.net.server

public Interface Client

extends Runnable, Closeable
Known Direct Subinterfaces
ch.qos.logback.core.net.server.RemoteReceiverClient
Known Direct Implementers
ch.qos.logback.core.net.server.ConcurrentServerRunner.ClientWrapper
Imports
java.io.Closeable, .IOException

A client of a ServerRunner.

This interface exists primarily to abstract away the details of the client's underlying Socket and the concurrency associated with handling multiple clients. Such realities make it difficult to create effective unit tests for the ServerRunner that are easy to understand and maintain.

This interface captures the only those details about a client that the ServerRunner cares about; namely, that it is something that

  1. is Runnable — i.e. it can be executed concurrently
  2. holds resources that need to be closed before the client is discarded
Author
Carl Harris

Method Summary

Modifier and TypeMethod and Description
public void
close()

Redeclares java.io.Closeable.close.

Closes any resources that are held by the client.
Inherited from java.lang.Runnable:
run

Method Detail

closeback to summary
public void close()

Redeclares java.io.Closeable.close.

Closes any resources that are held by the client.

Note that (as described in Doug Lea's discussion about interrupting I/O operations in "Concurrent Programming in Java" - Addison-Wesley Professional, 2nd edition, 1999) this method is used to interrupt any blocked I/O operation in the client when the server is shutting down. The client implementation must anticipate this potential, and gracefully exit when the blocked I/O operation throws the relevant IOException subclass.

Note also, that unlike Closeable#close() this method is not permitted to propagate any IOException that occurs when closing the underlying resource(s).