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, wait
getEventCount, requestMigration
handle
protected 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()
MigratableHandler
IOBalancer
can decide to migrate
a handler to another owner.getOwner
in interface MigratableHandler
protected SelectionKey getSelectionKey() throws IOException
IOException
public void onFailure(Throwable e)
SelectionHandler
SelectionHandler.handle()
throws an exception.
The idiom to use a handler is:
try{
handler.handle();
} catch(Throwable t) {
handler.onFailure(t);
}
onFailure
in interface SelectionHandler
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.