public abstract class AbstractHandler extends Object implements SelectionHandler, MigratableHandler
| Modifier and Type | Field and Description |
|---|---|
protected Channel |
channel |
protected SwCounter |
handleCount |
protected NioThread |
ioThread |
protected static int |
LOAD_TYPE |
protected ILogger |
logger |
protected SelectionKey |
selectionKey |
| Modifier and Type | Method and Description |
|---|---|
Channel |
getChannel() |
NioThread |
getOwner()
Get NioThread currently owning this handler.
|
void |
onFailure(Throwable e)
Is called when the
SelectionHandler.handle() throws an exception. |
protected abstract void |
publish() |
void |
start() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandlegetLoad, requestMigrationprotected static final int LOAD_TYPE
protected final SwCounter handleCount
protected final ILogger logger
protected final Channel channel
protected NioThread ioThread
protected SelectionKey selectionKey
public Channel getChannel()
public NioThread getOwner()
MigratableHandlerIOBalancer can decide to migrate
a handler to another owner.getOwner in interface MigratableHandlerpublic void start()
protected abstract void publish()
public 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 © 2017. All Rights Reserved.