public abstract class AbstractHandler extends Object implements MigratableHandler
| Modifier and Type | Field and Description |
|---|---|
protected TcpIpConnection |
connection |
protected TcpIpConnectionManager |
connectionManager |
protected IOService |
ioService |
protected NonBlockingIOThread |
ioThread |
protected ILogger |
logger |
protected SelectionKey |
selectionKey |
protected SocketChannelWrapper |
socketChannel |
| Constructor and Description |
|---|
AbstractHandler(TcpIpConnection connection,
NonBlockingIOThread ioThread,
int initialOps) |
| Modifier and Type | Method and Description |
|---|---|
NonBlockingIOThread |
getOwner()
Get NonBlockingIOThread currently owning this handler.
|
protected SelectionKey |
getSelectionKey() |
void |
onFailure(Throwable e)
Is called when the
SelectionHandler.handle() throws an exception. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEventCount, requestMigrationhandleprotected final ILogger logger
protected final SocketChannelWrapper socketChannel
protected final TcpIpConnection connection
protected final TcpIpConnectionManager connectionManager
protected final IOService ioService
protected NonBlockingIOThread ioThread
protected SelectionKey selectionKey
public AbstractHandler(TcpIpConnection connection, NonBlockingIOThread ioThread, int initialOps)
public NonBlockingIOThread getOwner()
MigratableHandlerIOBalancer can decide to migrate
a handler to another owner.getOwner in interface MigratableHandlerprotected SelectionKey getSelectionKey() throws IOException
IOExceptionpublic void onFailure(Throwable e)
SelectionHandlerSelectionHandler.handle() throws an exception.
The idiom to use a handler is:
try{
handler.handle();
} catch(Throwable t) {
handler.onFailure(t);
}
onFailure in interface SelectionHandlerCopyright © 2016 Hazelcast, Inc.. All Rights Reserved.