Package org.cometd.server.ext
Class ActivityExtension.SessionExtension
java.lang.Object
org.cometd.server.ext.ActivityExtension.SessionExtension
- All Implemented Interfaces:
ServerSession.Extension
- Enclosing class:
- ActivityExtension
public static class ActivityExtension.SessionExtension extends Object implements ServerSession.Extension
Monitors the activity of a single
ServerSession, disconnecting it
when the max inactivity period is exceeded.-
Constructor Summary
Constructors Constructor Description SessionExtension(ActivityExtension.Activity activity, long maxInactivityPeriod) -
Method Summary
Modifier and Type Method Description protected voiddisconnect(ServerSession session)protected longgetLastActivity()longgetMaxInactivityPeriod()booleanisInactive()protected voidmarkActive()booleanrcv(ServerSession session, ServerMessage.Mutable message)booleanrcvMeta(ServerSession session, ServerMessage.Mutable message)ServerMessagesend(ServerSession sender, ServerSession session, ServerMessage message)booleansendMeta(ServerSession sender, ServerSession session, ServerMessage.Mutable message)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cometd.bayeux.server.ServerSession.Extension
incoming, outgoing
-
Constructor Details
-
Method Details
-
getMaxInactivityPeriod
public long getMaxInactivityPeriod()- Returns:
- the max inactivity period, in milliseconds
-
getLastActivity
protected long getLastActivity()- Returns:
- the last activity timestamp, in nanoseconds
-
rcv
- Specified by:
rcvin interfaceServerSession.Extension
-
rcvMeta
- Specified by:
rcvMetain interfaceServerSession.Extension
-
send
- Specified by:
sendin interfaceServerSession.Extension
-
sendMeta
public boolean sendMeta(ServerSession sender, ServerSession session, ServerMessage.Mutable message)- Specified by:
sendMetain interfaceServerSession.Extension
-
markActive
protected void markActive() -
isInactive
public boolean isInactive() -
disconnect
-