public class MockServerListener<T extends ch.qos.logback.core.net.server.Client> extends Object implements ch.qos.logback.core.net.server.ServerListener<T>
ServerListener that has a blocking queue to pass a client
to a acceptClient() caller. If the close() method is
called while a caller is blocked waiting to take from the queue, the
caller's thread is interrupted.| Constructor and Description |
|---|
MockServerListener() |
| Modifier and Type | Method and Description |
|---|---|
T |
acceptClient() |
void |
addClient(T client) |
void |
close() |
Thread |
getWaiter() |
boolean |
isClosed() |
void |
setClosed(boolean closed) |
void |
setWaiter(Thread waiter) |
public Thread getWaiter()
public void setWaiter(Thread waiter)
public boolean isClosed()
public void setClosed(boolean closed)
public T acceptClient() throws IOException, InterruptedException
acceptClient in interface ch.qos.logback.core.net.server.ServerListener<T extends ch.qos.logback.core.net.server.Client>IOExceptionInterruptedExceptionpublic void addClient(T client)
public void close()
close in interface ch.qos.logback.core.net.server.ServerListener<T extends ch.qos.logback.core.net.server.Client>close in interface Closeableclose in interface AutoCloseableCopyright © 2005–2021 QOS.ch. All rights reserved.