com.hazelcast.nio.tcp
Class AbstractSelectionHandler
java.lang.Object
com.hazelcast.nio.tcp.AbstractSelectionHandler
- All Implemented Interfaces:
- MigratableHandler, SelectionHandler
- Direct Known Subclasses:
- ReadHandler, WriteHandler
public abstract class AbstractSelectionHandler
- extends Object
- implements MigratableHandler
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final ILogger logger
socketChannel
protected final SocketChannelWrapper socketChannel
connection
protected final TcpIpConnection connection
connectionManager
protected final TcpIpConnectionManager connectionManager
selector
protected Selector selector
ioSelector
protected IOSelector ioSelector
AbstractSelectionHandler
public AbstractSelectionHandler(TcpIpConnection connection,
IOSelector ioSelector,
int initialOps)
migrate
public void migrate(IOSelector newOwner)
- Migrates this handler to a new IOSelector thread.
The migration logic is rather simple:
- Submit a de-registration task to a current IOSelector thread
- The de-registration task submits a registration task to the new IOSelector thread
- Specified by:
migrate
in interface MigratableHandler
- Parameters:
newOwner
- target IOSelector this handler migrates to
getSelectionKey
protected SelectionKey getSelectionKey()
getOwner
public IOSelector getOwner()
- Get IOSelector currently owning this handler. Handler owner is a thread running this handler.
IOBalancer
can decide to migrate
a handler to another owner.
- Specified by:
getOwner
in interface MigratableHandler
- Returns:
- current owner
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.