Interface ServerListener<T extends Client>
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- All Known Implementing Classes:
ServerSocketListener
@Deprecated(since="2022-01-27") public interface ServerListener<T extends Client> extends java.io.CloseableDeprecated.This internal logback API is not supported by AEM as a Cloud Service.A listener that acceptsClientconnections on behalf of aServerRunner.This interface exists primarily to abstract away the details of the listener's underlying
ServerSocketand the concurrency associated with handling multiple clients. Such realities make it difficult to create effective unit tests for theServerRunnerthat are easy to understand and maintain.This interface captures the only those details about the listener that the
ServerRunnercares about; namely, that it is something that has an underlying resource (or resources) that need to be closed before the listener is discarded.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description TacceptClient()Deprecated.Accepts the next client that appears on this listener.voidclose()Deprecated.Closes any underlyingCloseableresources associated with this listener.
-
-
-
Method Detail
-
acceptClient
T acceptClient() throws java.io.IOException, java.lang.InterruptedException
Deprecated.Accepts the next client that appears on this listener.An implementation of this method is expected to block the calling thread and not return until either a client appears or an exception occurs.
- Returns:
- client object
- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
close
void close()
Deprecated.Closes any underlyingCloseableresources associated with this listener.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
IOExceptionsubclass.Note also, that unlike
Closeable.close()this method is not permitted to propagate anyIOExceptionthat occurs when closing the underlying resource(s).- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-