Class AbstractWebSocketTransport
- java.lang.Object
-
- org.cometd.common.AbstractTransport
-
- org.cometd.server.AbstractServerTransport
-
- org.cometd.websocket.server.common.AbstractWebSocketTransport
-
- All Implemented Interfaces:
ServerTransport,Transport,org.eclipse.jetty.util.component.Dumpable
- Direct Known Subclasses:
JettyWebSocketTransport,WebSocketTransport
public abstract class AbstractWebSocketTransport extends AbstractServerTransport
-
-
Nested Class Summary
-
Nested 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_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 protectedAbstractWebSocketTransport(BayeuxServerImpl bayeux)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMessagesPerFrame()StringgetProtocol()voidinit()Initializes the transport, resolving default and direct options.booleanisRequireHandshakePerConnection()protected List<String>normalizeURLMapping(String urlMapping)protected voidonClose(int code, String reason)protected StringtoJSON(ServerMessage message)protected voidwriteComplete(AbstractWebSocketEndPoint.Context context, List<ServerMessage> messages)-
Methods inherited from class org.cometd.server.AbstractServerTransport
allowMessageDeliveryDuringHandshake, destroy, dump, getBayeux, getInterval, getMaxInterval, getMaxLazyTimeout, getMaxMessageSize, getTimeout, isAllowMessageDeliveryDuringHandshake, isHandshakeReconnect, isMetaConnectDeliveryOnly, parseMessages, parseMessages, processReply, scheduleExpiration, setAllowMessageDeliveryDuringHandshake, setHandshakeReconnect, setInterval, setMaxInterval, setMaxLazyTimeout, setMaxMessageSize, setMetaConnectDeliveryOnly, setTimeout, sweep, 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 Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
PREFIX
public static final String PREFIX
- See Also:
- Constant Field Values
-
PROTOCOL_OPTION
public static final String PROTOCOL_OPTION
- See Also:
- Constant Field Values
-
MESSAGES_PER_FRAME_OPTION
public static final String MESSAGES_PER_FRAME_OPTION
- See Also:
- Constant Field Values
-
BUFFER_SIZE_OPTION
public static final String BUFFER_SIZE_OPTION
- See Also:
- Constant Field Values
-
IDLE_TIMEOUT_OPTION
public static final String IDLE_TIMEOUT_OPTION
- See Also:
- Constant Field Values
-
COMETD_URL_MAPPING_OPTION
public static final String COMETD_URL_MAPPING_OPTION
- See Also:
- Constant Field Values
-
REQUIRE_HANDSHAKE_PER_CONNECTION_OPTION
public static final String REQUIRE_HANDSHAKE_PER_CONNECTION_OPTION
- See Also:
- Constant Field Values
-
ENABLE_EXTENSION_PREFIX_OPTION
public static final String ENABLE_EXTENSION_PREFIX_OPTION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractWebSocketTransport
protected AbstractWebSocketTransport(BayeuxServerImpl bayeux)
-
-
Method Detail
-
init
public void init()
Description copied from class:AbstractServerTransportInitializes the transport, resolving default and direct options.- Overrides:
initin classAbstractServerTransport
-
getProtocol
public String getProtocol()
-
getMessagesPerFrame
public int getMessagesPerFrame()
-
isRequireHandshakePerConnection
public boolean isRequireHandshakePerConnection()
-
onClose
protected void onClose(int code, String reason)
-
toJSON
protected String toJSON(ServerMessage message)
- Overrides:
toJSONin classAbstractServerTransport
-
writeComplete
protected void writeComplete(AbstractWebSocketEndPoint.Context context, List<ServerMessage> messages)
-
-