This interface exists primarily to abstract away the details of the
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
ServerRunner cares about; namely, that it is something that
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
Copyright © 2005–2018 QOS.ch. All rights reserved.