|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.qos.logback.core.net.server.ServerSocketListener<T>
public abstract class ServerSocketListener<T extends Client>
A ServerListener that accepts connections on a ServerSocket.
| Constructor Summary | |
|---|---|
ServerSocketListener(ServerSocket serverSocket)
Constructs a new listener. |
|
| Method Summary | |
|---|---|
T |
acceptClient()
Accepts the next client that appears on this listener. |
void |
close()
Closes any underlying Closeable resources associated with this
listener. |
protected abstract T |
createClient(String id,
Socket socket)
Creates the client object for a new socket connection |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ServerSocketListener(ServerSocket serverSocket)
serverSocket - server socket delegate| Method Detail |
|---|
public T acceptClient()
throws IOException
An implementation of this method is expected to block the calling thread and not return until either a client appears or an exception occurs.
acceptClient in interface ServerListener<T extends Client>IOException
protected abstract T createClient(String id,
Socket socket)
throws IOException
id - identifier string for the clientsocket - client's socket connection
IOExceptionpublic void close()
Closeable resources 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 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).
close in interface ServerListener<T extends Client>close in interface Closeablepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||