public class ActivityExtension extends BayeuxServer.Extension.Adapter
Monitors the activity of ServerSessions and disconnects them after a period of inactivity.
The inactivity of a particular ServerSession is determined in two ways:
/meta/connect
messages but no other messages, while the server may send messages to the client; this is
configured via ActivityExtension.Activity.CLIENT/meta/connect messages; this is configured via
ActivityExtension.Activity.CLIENT_SERVERWhen the inactivity exceeds a configurable inactive period,
the ServerSession is disconnected.
| Modifier and Type | Class and Description |
|---|---|
static class |
ActivityExtension.Activity
The possible activity to monitor
|
static class |
ActivityExtension.SessionExtension
Monitors the activity of a single
ServerSession, disconnecting it
when the max inactivity period is exceeded. |
BayeuxServer.Extension.Adapter| Constructor and Description |
|---|
ActivityExtension(ActivityExtension.Activity activity,
long maxInactivityPeriod)
Creates an ActivityExtension to be installed in the
BayeuxServer |
| Modifier and Type | Method and Description |
|---|---|
ActivityExtension.Activity |
getActivity() |
long |
getMaxInactivityPeriod() |
protected ServerSession.Extension |
newSessionExtension(ServerSession session,
ServerMessage handshake)
Creates a new
ServerSession.Extension that monitors the activity of the given ServerSession |
boolean |
rcvMeta(ServerSession session,
ServerMessage.Mutable message) |
rcv, send, sendMetapublic ActivityExtension(ActivityExtension.Activity activity, long maxInactivityPeriod)
BayeuxServeractivity - the activity to monitormaxInactivityPeriod - the max inactivity period, in millisecondspublic ActivityExtension.Activity getActivity()
public long getMaxInactivityPeriod()
public boolean rcvMeta(ServerSession session, ServerMessage.Mutable message)
rcvMeta in interface BayeuxServer.ExtensionrcvMeta in class BayeuxServer.Extension.Adapterprotected ServerSession.Extension newSessionExtension(ServerSession session, ServerMessage handshake)
ServerSession.Extension that monitors the activity of the given ServerSessionsession - the ServerSession to monitorhandshake - the handshake messageServerSession.Extension that monitors the ServerSession activityCopyright © 2008–2019 The CometD Project. All rights reserved.