Package org.cometd.client.transport
Class ClientTransport
java.lang.Object
org.cometd.common.AbstractTransport
org.cometd.client.transport.ClientTransport
- All Implemented Interfaces:
org.cometd.bayeux.Transport
- Direct Known Subclasses:
HttpClientTransport
public abstract class ClientTransport extends AbstractTransport
ClientTransports are used by BayeuxClient to send and receive Bayeux messages.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceClientTransport.Factorystatic interfaceClientTransport.FailureHandlerstatic classClientTransport.FailureInfo -
Field Summary
Fields Modifier and Type Field Description static StringJSON_CONTEXT_OPTIONstatic StringMAX_MESSAGE_SIZE_OPTIONstatic StringMAX_NETWORK_DELAY_OPTIONstatic StringSCHEDULER_OPTIONstatic StringURL_OPTION -
Constructor Summary
Constructors Modifier Constructor Description protectedClientTransport(String name, String url, Map<String,Object> options)Deprecated.protectedClientTransport(String name, String url, Map<String,Object> options, ScheduledExecutorService scheduler) -
Method Summary
Modifier and Type Method Description abstract voidabort(Throwable failure)Aborts this transport, usually by cancelling all pending Bayeux messages that require a response, such as/meta/connects, without waiting for a response.abstract booleanaccept(String version)protected StringgenerateJSON(List<org.cometd.bayeux.Message.Mutable> messages)protected JSONContext.ClientgetJSONContextClient()longgetMaxNetworkDelay()protected ScheduledExecutorServicegetScheduler()StringgetURL()voidinit()protected voidinitScheduler()protected List<org.cometd.bayeux.Message.Mutable>parseMessages(String content)abstract voidsend(TransportListener listener, List<org.cometd.bayeux.Message.Mutable> messages)protected voidsetMaxNetworkDelay(long maxNetworkDelay)voidsetURL(String url)protected voidshutdownScheduler()voidterminate()Terminates this transport, usually by closing network connections opened directly by this transport.Methods inherited from class org.cometd.common.AbstractTransport
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefix
-
Field Details
-
URL_OPTION
- See Also:
- Constant Field Values
-
MAX_NETWORK_DELAY_OPTION
- See Also:
- Constant Field Values
-
JSON_CONTEXT_OPTION
- See Also:
- Constant Field Values
-
SCHEDULER_OPTION
- See Also:
- Constant Field Values
-
MAX_MESSAGE_SIZE_OPTION
- See Also:
- Constant Field Values
-
-
Constructor Details
-
ClientTransport
Deprecated. -
ClientTransport
-
-
Method Details
-
getURL
-
setURL
-
init
public void init() -
getJSONContextClient
-
initScheduler
protected void initScheduler() -
shutdownScheduler
protected void shutdownScheduler() -
getScheduler
-
abort
Aborts this transport, usually by cancelling all pending Bayeux messages that require a response, such as/meta/connects, without waiting for a response.- Parameters:
failure- the cause of the abort- See Also:
BayeuxClient.abort()
-
terminate
public void terminate()Terminates this transport, usually by closing network connections opened directly by this transport.- See Also:
ClientSession.disconnect()
-
accept
-
send
public abstract void send(TransportListener listener, List<org.cometd.bayeux.Message.Mutable> messages) -
parseMessages
protected List<org.cometd.bayeux.Message.Mutable> parseMessages(String content) throws ParseException- Throws:
ParseException
-
generateJSON
-
getMaxNetworkDelay
public long getMaxNetworkDelay() -
setMaxNetworkDelay
protected void setMaxNetworkDelay(long maxNetworkDelay)
-