public class ClientListenerNioListener extends GridNioServerListenerAdapter<ClientMessage>
Modifier and Type | Field and Description |
---|---|
static int |
CONN_CTX_HANDSHAKE_TIMEOUT_TASK
Connection handshake timeout task.
|
static int |
CONN_CTX_META_KEY
Connection-related metadata key.
|
static byte |
JDBC_CLIENT
JDBC driver handshake code.
|
static byte |
ODBC_CLIENT
ODBC driver handshake code.
|
static byte |
THIN_CLIENT
Thin client handshake code.
|
Constructor and Description |
---|
ClientListenerNioListener(GridKernalContext ctx,
GridSpinBusyLock busyLock,
ClientConnectorConfiguration cliConnCfg)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
onConnected(GridNioSession ses)
This method is called whenever a new client is connected and session is created.
|
void |
onDisconnected(GridNioSession ses,
@Nullable Exception e)
This method is called whenever client is disconnected due to correct connection close
or due to
IOException during network operations. |
void |
onFailure(FailureType failureType,
Throwable failure)
Called when critical failure occurs in server implementation.
|
void |
onMessage(GridNioSession ses,
ClientMessage msg)
This method is called whenever a
GridNioParser returns non-null value. |
void |
onSessionIdleTimeout(GridNioSession ses)
Called when session did not receive any activity within timeout interval.
|
onMessageSent, onSessionWriteTimeout
public static final byte ODBC_CLIENT
public static final byte JDBC_CLIENT
public static final byte THIN_CLIENT
public static final int CONN_CTX_HANDSHAKE_TIMEOUT_TASK
public static final int CONN_CTX_META_KEY
public ClientListenerNioListener(GridKernalContext ctx, GridSpinBusyLock busyLock, ClientConnectorConfiguration cliConnCfg)
ctx
- Context.busyLock
- Shutdown busy lock.cliConnCfg
- Client connector configuration.public void onConnected(GridNioSession ses)
ses
- Newly created session for remote client.public void onDisconnected(GridNioSession ses, @Nullable @Nullable Exception e)
IOException
during network operations.ses
- Closed session.e
- Exception occurred, if any.public void onMessage(GridNioSession ses, ClientMessage msg)
GridNioParser
returns non-null value.ses
- Session on which message was received.msg
- Parsed message.public void onSessionIdleTimeout(GridNioSession ses)
onSessionIdleTimeout
in interface GridNioServerListener<ClientMessage>
onSessionIdleTimeout
in class GridNioServerListenerAdapter<ClientMessage>
ses
- Session that is idle.public void onFailure(FailureType failureType, Throwable failure)
onFailure
in interface GridNioServerListener<ClientMessage>
onFailure
in class GridNioServerListenerAdapter<ClientMessage>
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021