org.cometd.bayeux.server.BayeuxServer.Extensionpublic class ActivityExtension
extends java.lang.Object
implements org.cometd.bayeux.server.BayeuxServer.Extension
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 | 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. |
| Constructor | Description |
|---|---|
ActivityExtension(ActivityExtension.Activity activity,
long maxInactivityPeriod) |
Creates an ActivityExtension to be installed in the
BayeuxServer |
| Modifier and Type | Method | Description |
|---|---|---|
ActivityExtension.Activity |
getActivity() |
|
long |
getMaxInactivityPeriod() |
|
protected org.cometd.bayeux.server.ServerSession.Extension |
newSessionExtension(org.cometd.bayeux.server.ServerSession session,
org.cometd.bayeux.server.ServerMessage handshake) |
Creates a new
ServerSession.Extension that monitors the activity of the given ServerSession |
boolean |
rcvMeta(org.cometd.bayeux.server.ServerSession session,
org.cometd.bayeux.server.ServerMessage.Mutable message) |
public 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(org.cometd.bayeux.server.ServerSession session,
org.cometd.bayeux.server.ServerMessage.Mutable message)
rcvMeta in interface org.cometd.bayeux.server.BayeuxServer.Extensionprotected org.cometd.bayeux.server.ServerSession.Extension newSessionExtension(org.cometd.bayeux.server.ServerSession session,
org.cometd.bayeux.server.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–2017 The CometD Project. All rights reserved.