Class AbstractWebSocketTransport<S>
java.lang.Object
org.cometd.common.AbstractTransport
org.cometd.server.AbstractServerTransport
org.cometd.websocket.server.common.AbstractWebSocketTransport<S>
- All Implemented Interfaces:
ServerTransport
,Transport
,org.eclipse.jetty.util.component.Dumpable
- Direct Known Subclasses:
JettyWebSocketTransport
,WebSocketTransport
public abstract class AbstractWebSocketTransport<S> extends AbstractServerTransport
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractWebSocketTransport.AbstractWebSocketScheduler
Nested classes/interfaces inherited from class org.cometd.server.AbstractServerTransport
AbstractServerTransport.Scheduler
-
Field Summary
Fields Modifier and Type Field Description static String
BUFFER_SIZE_OPTION
static String
COMETD_URL_MAPPING_OPTION
static String
ENABLE_EXTENSION_PREFIX_OPTION
static String
IDLE_TIMEOUT_OPTION
static String
MESSAGES_PER_FRAME_OPTION
static String
NAME
static String
PREFIX
static String
PROTOCOL_OPTION
static 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(BayeuxServerImpl bayeux)
-
Method Summary
Modifier and Type Method Description protected boolean
checkProtocol(List<String> serverProtocols, List<String> clientProtocols)
void
destroy()
BayeuxContext
getContext()
int
getMessagesPerFrame()
String
getProtocol()
ScheduledExecutorService
getScheduler()
protected void
handleException(S wsSession, ServerSession session, Throwable exception)
protected void
handleJSONParseException(S wsSession, ServerSession session, String json, Throwable exception)
void
init()
Initializes the transport, resolving default and direct options.protected ScheduledExecutorService
newScheduledExecutor()
protected List<String>
normalizeURLMapping(String urlMapping)
protected void
onClose(int code, String reason)
protected abstract void
send(S wsSession, ServerSession session, 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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.cometd.bayeux.Transport
getName, getOption, getOptionNames, getOptionPrefix
-
Field Details
-
NAME
- See Also:
- Constant Field Values
-
PREFIX
- See Also:
- Constant Field Values
-
PROTOCOL_OPTION
- See Also:
- Constant Field Values
-
MESSAGES_PER_FRAME_OPTION
- See Also:
- Constant Field Values
-
BUFFER_SIZE_OPTION
- See Also:
- Constant Field Values
-
IDLE_TIMEOUT_OPTION
- See Also:
- Constant Field Values
-
COMETD_URL_MAPPING_OPTION
- See Also:
- Constant Field Values
-
REQUIRE_HANDSHAKE_PER_CONNECTION_OPTION
- See Also:
- Constant Field Values
-
ENABLE_EXTENSION_PREFIX_OPTION
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
init
public void init()Description copied from class:AbstractServerTransport
Initializes the transport, resolving default and direct options.- Overrides:
init
in classAbstractServerTransport
-
destroy
public void destroy()- Overrides:
destroy
in classAbstractServerTransport
-
newScheduledExecutor
-
getScheduler
-
getProtocol
-
getMessagesPerFrame
public int getMessagesPerFrame() -
checkProtocol
-
getContext
- Returns:
- The current transport context or null if no current context
-
normalizeURLMapping
-
handleJSONParseException
protected void handleJSONParseException(S wsSession, ServerSession session, String json, Throwable exception) -
handleException
-
send
protected abstract void send(S wsSession, ServerSession session, String data, org.eclipse.jetty.util.Callback callback) -
onClose
-