public static class ActivityExtension.SessionExtension extends Object implements ServerSession.Extension
ServerSession
, disconnecting it
when the max inactivity period is exceeded.Constructor and Description |
---|
SessionExtension(ActivityExtension.Activity activity,
long maxInactivityPeriod) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
incoming, outgoing
public SessionExtension(ActivityExtension.Activity activity, long maxInactivityPeriod)
public long getMaxInactivityPeriod()
protected long getLastActivity()
public boolean rcv(ServerSession session, ServerMessage.Mutable message)
ServerSession.Extension
Blocking version of ServerSession.Extension.incoming(ServerSession, ServerMessage.Mutable, Promise)
for non-meta messages.
rcv
in interface ServerSession.Extension
session
- the session that sent the messagemessage
- the incoming messagepublic boolean rcvMeta(ServerSession session, ServerMessage.Mutable message)
ServerSession.Extension
Blocking version of ServerSession.Extension.incoming(ServerSession, ServerMessage.Mutable, Promise)
for meta messages.
rcvMeta
in interface ServerSession.Extension
session
- the session that sent the messagemessage
- the incoming messagepublic ServerMessage send(ServerSession sender, ServerSession session, ServerMessage message)
ServerSession.Extension
Blocking version of ServerSession.Extension.outgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)
for non-meta messages.
send
in interface ServerSession.Extension
sender
- the session that sent the message or nullsession
- the session receiving the messagemessage
- the outgoing messagepublic boolean sendMeta(ServerSession sender, ServerSession session, ServerMessage.Mutable message)
ServerSession.Extension
Blocking version of ServerSession.Extension.outgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)
for meta messages.
sendMeta
in interface ServerSession.Extension
sender
- the session that sent the message or nullsession
- the session receiving the messagemessage
- the outgoing messageprotected void markActive()
public boolean isInactive()
protected void disconnect(ServerSession session)
Copyright © 2008–2024 The CometD Project. All rights reserved.