public class ActivityExtension extends Object implements BayeuxServer.Extension
Monitors the activity of ServerSession
s 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_SERVER
When 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. |
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)
Blocking version of
BayeuxServer.Extension.incoming(ServerSession, ServerMessage.Mutable, Promise)
for meta messages. |
public ActivityExtension(ActivityExtension.Activity activity, long maxInactivityPeriod)
BayeuxServer
activity
- the activity to monitormaxInactivityPeriod
- the max inactivity period, in millisecondspublic ActivityExtension.Activity getActivity()
public long getMaxInactivityPeriod()
public boolean rcvMeta(ServerSession session, ServerMessage.Mutable message)
BayeuxServer.Extension
Blocking version of BayeuxServer.Extension.incoming(ServerSession, ServerMessage.Mutable, Promise)
for meta messages.
rcvMeta
in interface BayeuxServer.Extension
session
- the session that sent the messagemessage
- the incoming messageprotected ServerSession.Extension newSessionExtension(ServerSession session, ServerMessage handshake)
ServerSession.Extension
that monitors the activity of the given ServerSession
session
- the ServerSession
to monitorhandshake
- the handshake messageServerSession.Extension
that monitors the ServerSession
activityCopyright © 2008–2024 The CometD Project. All rights reserved.