public abstract class SessionConnectionBase extends ConnectionBase
Modifier and Type | Field and Description |
---|---|
protected ScheduledExecutorService |
executor |
static String |
SESSION_CLIENT_VERSION |
messenger, session, statistics
Constructor and Description |
---|
SessionConnectionBase(ConnectionInformation connectionInformation) |
Modifier and Type | Method and Description |
---|---|
void |
addPrivilegeListener(PrivilegeListener listener)
Add a listener to the privileges of the session
|
void |
dispose()
Dispose the connection
|
Set<String> |
getPrivileges()
Return the list of currently granted privileges.
|
abstract String |
getRequiredVersion() |
protected void |
handlePrivChange(Set<String> privileges) |
protected void |
modifyFilterChain(IoSession session,
Properties properties) |
protected void |
onConnectionClosed() |
protected void |
onConnectionEstablished() |
protected void |
processSessionReply(Message message) |
void |
removePrivilegeListener(PrivilegeListener listener) |
protected void |
requestSession() |
addConnectionStateListener, cancelConnection, connect, connect, connectFailed, disconnect, disconnect, exceptionCaught, finalize, getConnectionInformation, getConnectTimeout, getIntProperty, getMessageTimeout, getPingPeriod, getSessionProperties, getSocketReceiveBufferSize, getSocketSendBufferSize, getState, getStatistics, isConnected, messageReceived, messageSent, onConnectionBound, performConnect, performLookup, removeConnectionStateListener, resolvedRemoteAddress, sessionClosed, sessionCreated, sessionIdle, sessionOpened, setBound, setCallbackFactory, setupConnector, switchState
public static final String SESSION_CLIENT_VERSION
protected ScheduledExecutorService executor
public SessionConnectionBase(ConnectionInformation connectionInformation)
public abstract String getRequiredVersion()
public void dispose()
Connection
A dispose will also act as a disconnect.
Connections must be disposed in order to clean up all resources. In the
past the Connection.disconnect()
call was enough and, if possible, most
resources (sockets) should be closed when disconnecting. Still some
resources can be re-used and these need to be cleaned up in the
Connection.dispose()
call.
dispose
in interface Connection
dispose
in class ConnectionBase
protected void onConnectionEstablished()
onConnectionEstablished
in class ConnectionBase
protected void onConnectionClosed()
onConnectionClosed
in class ConnectionBase
protected void requestSession()
protected void processSessionReply(Message message)
protected void modifyFilterChain(IoSession session, Properties properties)
public void addPrivilegeListener(PrivilegeListener listener)
Connection
When adding a new listener it will receive an initial call with the current privileges.
public void removePrivilegeListener(PrivilegeListener listener)
public Set<String> getPrivileges()
Connection
null
.