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 classAbstractWebSocketTransport.AbstractWebSocketSchedulerNested classes/interfaces inherited from class org.cometd.server.AbstractServerTransport
AbstractServerTransport.Scheduler -
Field Summary
Fields Modifier and Type Field Description static StringBUFFER_SIZE_OPTIONstatic StringCOMETD_URL_MAPPING_OPTIONstatic StringENABLE_EXTENSION_PREFIX_OPTIONstatic StringIDLE_TIMEOUT_OPTIONstatic StringMESSAGES_PER_FRAME_OPTIONstatic StringNAMEstatic StringPREFIXstatic StringPROTOCOL_OPTIONstatic StringREQUIRE_HANDSHAKE_PER_CONNECTION_OPTIONFields 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 protectedAbstractWebSocketTransport(BayeuxServerImpl bayeux) -
Method Summary
Modifier and Type Method Description protected booleancheckProtocol(List<String> serverProtocols, List<String> clientProtocols)voiddestroy()BayeuxContextgetContext()intgetMessagesPerFrame()StringgetProtocol()ScheduledExecutorServicegetScheduler()protected voidhandleException(S wsSession, ServerSession session, Throwable exception)protected voidhandleJSONParseException(S wsSession, ServerSession session, String json, Throwable exception)voidinit()Initializes the transport, resolving default and direct options.protected ScheduledExecutorServicenewScheduledExecutor()protected List<String>normalizeURLMapping(String urlMapping)protected voidonClose(int code, String reason)protected abstract voidsend(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, toStringMethods inherited from class org.cometd.common.AbstractTransport
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefixMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:AbstractServerTransportInitializes the transport, resolving default and direct options.- Overrides:
initin classAbstractServerTransport
-
destroy
public void destroy()- Overrides:
destroyin 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
-