Interface IOHandler
- All Known Implementing Classes:
AbstractReadaheadRemotePeer,AbstractRemotePeer,Client,CommandConnection,MockIOHandler,NullIOHandler,Server,SSLIOHandler,TableDataProtocol.RemoteClient,TableDataProtocol.RemoteServer,TCPConnectionImpl,WClient,WebsocketCommClient
public interface IOHandler
These are the I/O events that can be generated by the NIO scheduler.
When the callbacks are entered, no locks are held by the calling thread. If the application runs in a
multithreaded environment, then the handler implementation must take care to synchronize itself.
In particular, handleIncoming must synchronize on the IOJob argument while it is accessing the read buffer. At
least one existing implementation of the IOJob interface is constructed to explicitly allow other threads to add data
to the read buffer while a previous call to handleIncoming is still running.
Created by IntelliJ IDEA. User: jrauser Date: Sep 26, 2006 Time: 7:45:03 PM To change this template use File |
Settings | File Templates.
-
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidhandleError(IOJob job, IOException x) booleanhandleIncoming(IOJob job) Handle input from an IOJob.voidhandleOutgoing(IOJob job, long numFlushed) voidhandleTimeout(IOJob job) void
-
Method Details
-
startJob
-
endJob
-
handleIncoming
Handle input from an IOJob. This method will be called again if it returns true, and it must do so if the handler does not consume all the data (or it might never be called to finish processing the buffer).- Parameters:
job- the IOJob containing the input data- Returns:
- true if there is or might be enough data to process another message, false if the buffer is empty or there was an error
-
handleOutgoing
-
handleEOF
-
handleTimeout
-
handleError
-