public abstract class AbstractWebSocketTransport extends HttpClientTransport implements MessageClientTransport
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractWebSocketTransport.Delegate |
ClientTransport.Factory, ClientTransport.FailureHandler, ClientTransport.FailureInfo
Modifier and Type | Field and Description |
---|---|
static String |
CONNECT_TIMEOUT_OPTION |
protected static String |
COOKIE_HEADER |
static String |
IDLE_TIMEOUT_OPTION |
static int |
MAX_CLOSE_REASON_LENGTH |
static String |
NAME |
static int |
NORMAL_CLOSE_CODE |
static String |
PERMESSAGE_DEFLATE_OPTION |
static String |
PREFIX |
static String |
PROTOCOL_OPTION |
static String |
STICKY_RECONNECT_OPTION |
JSON_CONTEXT_OPTION, MAX_MESSAGE_SIZE_OPTION, MAX_NETWORK_DELAY_OPTION, MAX_SEND_BAYEUX_MESSAGE_SIZE_OPTION, SCHEDULER_OPTION, URL_OPTION
Modifier | Constructor and Description |
---|---|
protected |
AbstractWebSocketTransport(String url,
Map<String,Object> options,
ScheduledExecutorService scheduler) |
Modifier and Type | Method and Description |
---|---|
void |
abort(Throwable failure)
Aborts this transport, usually by cancelling all pending Bayeux messages that require a response,
such as
/meta/connect s, without waiting for a response. |
protected abstract AbstractWebSocketTransport.Delegate |
connect(String uri,
TransportListener listener,
List<Message.Mutable> messages) |
long |
getConnectTimeout() |
protected AbstractWebSocketTransport.Delegate |
getDelegate() |
long |
getIdleTimeout() |
String |
getProtocol() |
void |
init() |
boolean |
isPerMessageDeflateEnabled() |
boolean |
isStickyReconnect() |
protected void |
locked(Runnable block) |
protected <T> T |
locked(Supplier<T> block) |
void |
send(TransportListener listener,
List<Message.Mutable> messages) |
void |
setMessageTransportListener(TransportListener listener) |
void |
setURL(String url) |
void |
terminate()
Terminates this transport, usually by closing network connections opened directly by this transport.
|
getCookies, getCookieStore, setCookieStore, storeCookies
accept, generateJSON, getJSONContextClient, getMaxNetworkDelay, getScheduler, getURL, initScheduler, parseMessages, setMaxNetworkDelay, shutdownScheduler
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefix
public static final String PREFIX
public static final String NAME
public static final String PROTOCOL_OPTION
public static final String PERMESSAGE_DEFLATE_OPTION
public static final String CONNECT_TIMEOUT_OPTION
public static final String IDLE_TIMEOUT_OPTION
public static final String STICKY_RECONNECT_OPTION
public static final int MAX_CLOSE_REASON_LENGTH
public static final int NORMAL_CLOSE_CODE
protected static final String COOKIE_HEADER
protected AbstractWebSocketTransport(String url, Map<String,Object> options, ScheduledExecutorService scheduler)
public void setMessageTransportListener(TransportListener listener)
setMessageTransportListener
in interface MessageClientTransport
listener
- the listener that handles unsolicited messages from the serverpublic void setURL(String url)
setURL
in class ClientTransport
public void init()
init
in class ClientTransport
protected void locked(Runnable block)
protected <T> T locked(Supplier<T> block)
public String getProtocol()
public boolean isPerMessageDeflateEnabled()
public long getIdleTimeout()
public long getConnectTimeout()
public boolean isStickyReconnect()
public void abort(Throwable failure)
ClientTransport
/meta/connect
s, without waiting for a response.abort
in class ClientTransport
failure
- the cause of the abortBayeuxClient.abort()
public void terminate()
ClientTransport
terminate
in class ClientTransport
ClientSession.disconnect()
protected AbstractWebSocketTransport.Delegate getDelegate()
public void send(TransportListener listener, List<Message.Mutable> messages)
send
in class ClientTransport
protected abstract AbstractWebSocketTransport.Delegate connect(String uri, TransportListener listener, List<Message.Mutable> messages)
Copyright © 2008–2024 The CometD Project. All rights reserved.