Class AbstractWebSocketTransport<S>
- java.lang.Object
-
- org.cometd.common.AbstractTransport
-
- org.cometd.server.AbstractServerTransport
-
- org.cometd.websocket.server.common.AbstractWebSocketTransport<S>
-
- All Implemented Interfaces:
org.cometd.bayeux.server.ServerTransport
,org.cometd.bayeux.Transport
,org.eclipse.jetty.util.component.Dumpable
public abstract class AbstractWebSocketTransport<S> extends org.cometd.server.AbstractServerTransport
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractWebSocketTransport.AbstractWebSocketScheduler
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BUFFER_SIZE_OPTION
static java.lang.String
COMETD_URL_MAPPING_OPTION
static java.lang.String
ENABLE_EXTENSION_PREFIX_OPTION
static java.lang.String
IDLE_TIMEOUT_OPTION
static java.lang.String
MESSAGES_PER_FRAME_OPTION
static java.lang.String
NAME
static java.lang.String
PREFIX
static java.lang.String
PROTOCOL_OPTION
static java.lang.String
REQUIRE_HANDSHAKE_PER_CONNECTION_OPTION
-
Fields inherited from class org.cometd.server.AbstractServerTransport
_logger, ALLOW_MESSAGE_DELIVERY_DURING_HANDSHAKE, HANDSHAKE_RECONNECT_OPTION, INTERVAL_OPTION, JSON_CONTEXT_OPTION, MAX_INTERVAL_OPTION, MAX_LAZY_TIMEOUT_OPTION, MAX_MESSAGE_SIZE_OPTION, MAX_PROCESSING_OPTION, MAX_QUEUE_OPTION, META_CONNECT_DELIVERY_OPTION, TIMEOUT_OPTION
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractWebSocketTransport(org.cometd.server.BayeuxServerImpl bayeux)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
checkProtocol(java.util.List<java.lang.String> serverProtocols, java.util.List<java.lang.String> clientProtocols)
void
destroy()
org.cometd.bayeux.server.BayeuxContext
getContext()
int
getMessagesPerFrame()
java.lang.String
getProtocol()
java.util.concurrent.ScheduledExecutorService
getScheduler()
protected void
handleException(S wsSession, org.cometd.bayeux.server.ServerSession session, java.lang.Throwable exception)
protected void
handleJSONParseException(S wsSession, org.cometd.bayeux.server.ServerSession session, java.lang.String json, java.lang.Throwable exception)
void
init()
protected java.util.concurrent.ScheduledExecutorService
newScheduledExecutor()
protected java.util.List<java.lang.String>
normalizeURLMapping(java.lang.String urlMapping)
protected void
onClose(int code, java.lang.String reason)
protected abstract void
send(S wsSession, org.cometd.bayeux.server.ServerSession session, java.lang.String data, org.eclipse.jetty.util.Callback callback)
-
Methods inherited from class org.cometd.server.AbstractServerTransport
allowMessageDeliveryDuringHandshake, dump, dump, getAdvice, getBayeux, getInterval, getMaxInterval, getMaxLazyTimeout, getMaxMessageSize, getTimeout, isAllowMessageDeliveryDuringHandshake, isHandshakeReconnect, isMetaConnectDeliveryOnly, parseMessages, parseMessages, processReply, scheduleExpiration, setAllowMessageDeliveryDuringHandshake, setHandshakeReconnect, setInterval, setMaxInterval, setMaxLazyTimeout, setMaxMessageSize, setMetaConnectDeliveryOnly, setTimeout, sweep, toJSONBytes, toString
-
Methods inherited from class org.cometd.common.AbstractTransport
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefix
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
PREFIX
public static final java.lang.String PREFIX
- See Also:
- Constant Field Values
-
PROTOCOL_OPTION
public static final java.lang.String PROTOCOL_OPTION
- See Also:
- Constant Field Values
-
MESSAGES_PER_FRAME_OPTION
public static final java.lang.String MESSAGES_PER_FRAME_OPTION
- See Also:
- Constant Field Values
-
BUFFER_SIZE_OPTION
public static final java.lang.String BUFFER_SIZE_OPTION
- See Also:
- Constant Field Values
-
IDLE_TIMEOUT_OPTION
public static final java.lang.String IDLE_TIMEOUT_OPTION
- See Also:
- Constant Field Values
-
COMETD_URL_MAPPING_OPTION
public static final java.lang.String COMETD_URL_MAPPING_OPTION
- See Also:
- Constant Field Values
-
REQUIRE_HANDSHAKE_PER_CONNECTION_OPTION
public static final java.lang.String REQUIRE_HANDSHAKE_PER_CONNECTION_OPTION
- See Also:
- Constant Field Values
-
ENABLE_EXTENSION_PREFIX_OPTION
public static final java.lang.String ENABLE_EXTENSION_PREFIX_OPTION
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init()
- Overrides:
init
in classorg.cometd.server.AbstractServerTransport
-
destroy
public void destroy()
- Overrides:
destroy
in classorg.cometd.server.AbstractServerTransport
-
newScheduledExecutor
protected java.util.concurrent.ScheduledExecutorService newScheduledExecutor()
-
getScheduler
public java.util.concurrent.ScheduledExecutorService getScheduler()
-
getProtocol
public java.lang.String getProtocol()
-
getMessagesPerFrame
public int getMessagesPerFrame()
-
checkProtocol
protected boolean checkProtocol(java.util.List<java.lang.String> serverProtocols, java.util.List<java.lang.String> clientProtocols)
-
getContext
public org.cometd.bayeux.server.BayeuxContext getContext()
-
normalizeURLMapping
protected java.util.List<java.lang.String> normalizeURLMapping(java.lang.String urlMapping)
-
handleJSONParseException
protected void handleJSONParseException(S wsSession, org.cometd.bayeux.server.ServerSession session, java.lang.String json, java.lang.Throwable exception)
-
handleException
protected void handleException(S wsSession, org.cometd.bayeux.server.ServerSession session, java.lang.Throwable exception)
-
send
protected abstract void send(S wsSession, org.cometd.bayeux.server.ServerSession session, java.lang.String data, org.eclipse.jetty.util.Callback callback)
-
onClose
protected void onClose(int code, java.lang.String reason)
-
-