org.cometd.server.transport
Class LongPollingTransport
java.lang.Object
org.cometd.server.AbstractServerTransport
org.cometd.server.transport.HttpTransport
org.cometd.server.transport.LongPollingTransport
- All Implemented Interfaces:
- ServerTransport, Transport
- Direct Known Subclasses:
- JSONPTransport, JSONTransport
public abstract class LongPollingTransport
- extends HttpTransport
Abstract Long Polling Transport.
Transports based on this class can be configured with servlet init parameters:
- browserId
- The Cookie name used to save a browser ID.
- maxSessionsPerBrowser
- The maximum number of long polling sessions allowed per browser.
- multiSessionInterval
- The polling interval to use once max session per browser is exceeded.
- autoBatch
- If true a batch will be automatically created to span the handling of messages received from a session.
| Methods inherited from class org.cometd.server.AbstractServerTransport |
getAdvice, getBayeux, getInterval, getMaxInterval, getMaxLazyTimeout, getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, getTimeout, isMetaConnectDeliveryOnly, setAdvice, setInterval, setMaxInterval, setMaxLazyTimeout, setMetaConnectDeliveryOnly, setOption, setOptionPrefix, setTimeout |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PREFIX
public static final String PREFIX
- See Also:
- Constant Field Values
BROWSER_ID_OPTION
public static final String BROWSER_ID_OPTION
- See Also:
- Constant Field Values
MAX_SESSIONS_PER_BROWSER_OPTION
public static final String MAX_SESSIONS_PER_BROWSER_OPTION
- See Also:
- Constant Field Values
MULTI_SESSION_INTERVAL_OPTION
public static final String MULTI_SESSION_INTERVAL_OPTION
- See Also:
- Constant Field Values
AUTOBATCH_OPTION
public static final String AUTOBATCH_OPTION
- See Also:
- Constant Field Values
_browserId
protected String _browserId
LongPollingTransport
protected LongPollingTransport(BayeuxServerImpl bayeux,
String name)
init
protected void init()
- Description copied from class:
AbstractServerTransport
- Initialise the transport.
Initialise the transport, resolving default and direct options.
After the call to init, the
#getMutableOptions() set should
be reset to reflect only the options that can be changed on a running
transport.
This implementation clears the mutable options set.
- Overrides:
init in class HttpTransport
getBrowserId
protected String getBrowserId(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
addBrowserSession
protected boolean addBrowserSession(String browserId,
String clientId)
removeBrowserSession
protected boolean removeBrowserSession(String browserId,
String clientId)
getBrowserSessions
protected AtomicInteger getBrowserSessions(String browserId)
handle
public void handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException,
javax.servlet.ServletException
- Specified by:
handle in class HttpTransport
- Throws:
IOException
javax.servlet.ServletException
isAlwaysFlushingAfterHandle
protected abstract boolean isAlwaysFlushingAfterHandle()
- Returns:
- true if the transport always flushes at the end of a call to
handle(HttpServletRequest, HttpServletResponse).
send
protected abstract PrintWriter send(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
PrintWriter writer,
ServerMessage message)
throws IOException
- Throws:
IOException
complete
protected abstract void complete(PrintWriter writer)
throws IOException
- Throws:
IOException
Copyright © 2008-2010 Dojo Foundation. All Rights Reserved.