public abstract class AbstractHandler extends Object implements SelectionHandler, MigratableHandler, Closeable
Modifier and Type | Field and Description |
---|---|
protected Channel |
channel |
protected SwCounter |
completedMigrations |
protected SwCounter |
handleCount |
protected NioThread |
ioThread |
protected static int |
LOAD_BALANCING_BYTE |
protected static int |
LOAD_BALANCING_FRAME |
protected static int |
LOAD_BALANCING_HANDLE |
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, wait
handle
getLoad, requestMigration
protected static final int LOAD_BALANCING_HANDLE
protected static final int LOAD_BALANCING_BYTE
protected static final int LOAD_BALANCING_FRAME
protected static final int LOAD_TYPE
protected final SwCounter handleCount
protected final SwCounter completedMigrations
protected final ILogger logger
protected final Channel channel
protected NioThread ioThread
protected SelectionKey selectionKey
public Channel getChannel()
public NioThread getOwner()
MigratableHandler
IOBalancer
can decide to migrate
a handler to another owner.getOwner
in interface MigratableHandler
public void start()
protected abstract void publish()
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 © 2018 Hazelcast, Inc.. All Rights Reserved.