Class AbstractWebSocketTransport
java.lang.Object
org.cometd.common.AbstractTransport
org.cometd.client.transport.ClientTransport
org.cometd.client.transport.HttpClientTransport
org.cometd.websocket.client.common.AbstractWebSocketTransport
- All Implemented Interfaces:
Transport
,MessageClientTransport
- Direct Known Subclasses:
JettyWebSocketTransport
,WebSocketTransport
public abstract class AbstractWebSocketTransport extends HttpClientTransport implements MessageClientTransport
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractWebSocketTransport.Delegate
Nested classes/interfaces inherited from class org.cometd.client.transport.ClientTransport
ClientTransport.Factory, ClientTransport.FailureHandler, ClientTransport.FailureInfo
-
Field Summary
Fields Modifier and Type Field Description protected Object
_lock
static String
CONNECT_TIMEOUT_OPTION
static String
IDLE_TIMEOUT_OPTION
static String
NAME
static String
PREFIX
static String
PROTOCOL_OPTION
static String
STICKY_RECONNECT_OPTION
Fields inherited from class org.cometd.client.transport.ClientTransport
JSON_CONTEXT_OPTION, logger, MAX_MESSAGE_SIZE_OPTION, MAX_NETWORK_DELAY_OPTION, SCHEDULER_OPTION, URL_OPTION
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractWebSocketTransport(String url, Map<String,Object> options, ScheduledExecutorService scheduler)
-
Method Summary
Modifier and Type Method Description void
abort()
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
isStickyReconnect()
void
send(TransportListener listener, List<Message.Mutable> messages)
void
setMessageTransportListener(TransportListener listener)
void
setURL(String url)
protected void
storeCookies(Map<String,List<String>> headers)
void
terminate()
Terminates this transport, usually by closing network connections opened directly by this transport.Methods inherited from class org.cometd.client.transport.HttpClientTransport
getCookies, getCookieStore, setCookieStore, storeCookies
Methods inherited from class org.cometd.client.transport.ClientTransport
accept, generateJSON, getMaxNetworkDelay, getURL, parseMessages, setMaxNetworkDelay
Methods inherited from class org.cometd.common.AbstractTransport
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefix
-
Field Details
-
PREFIX
- See Also:
- Constant Field Values
-
NAME
- See Also:
- Constant Field Values
-
PROTOCOL_OPTION
- See Also:
- Constant Field Values
-
CONNECT_TIMEOUT_OPTION
- See Also:
- Constant Field Values
-
IDLE_TIMEOUT_OPTION
- See Also:
- Constant Field Values
-
STICKY_RECONNECT_OPTION
- See Also:
- Constant Field Values
-
_lock
-
-
Constructor Details
-
AbstractWebSocketTransport
protected AbstractWebSocketTransport(String url, Map<String,Object> options, ScheduledExecutorService scheduler)
-
-
Method Details
-
setMessageTransportListener
- Specified by:
setMessageTransportListener
in interfaceMessageClientTransport
- Parameters:
listener
- the listener that handles unsolicited messages from the server
-
setURL
- Overrides:
setURL
in classClientTransport
-
init
public void init()- Overrides:
init
in classClientTransport
-
getProtocol
-
getIdleTimeout
public long getIdleTimeout() -
getConnectTimeout
public long getConnectTimeout() -
isStickyReconnect
public boolean isStickyReconnect() -
abort
public void abort()Description copied from class:ClientTransport
Aborts this transport, usually by cancelling all pending Bayeux messages that require a response, such as/meta/connect
s, without waiting for a response.- Specified by:
abort
in classClientTransport
- See Also:
BayeuxClient.abort()
-
terminate
public void terminate()Description copied from class:ClientTransport
Terminates this transport, usually by closing network connections opened directly by this transport.- Overrides:
terminate
in classClientTransport
- See Also:
BayeuxClient.disconnect()
-
getDelegate
-
send
- Specified by:
send
in classClientTransport
-
connect
protected abstract AbstractWebSocketTransport.Delegate connect(String uri, TransportListener listener, List<Message.Mutable> messages) -
storeCookies
-