public abstract class ClientTransport extends AbstractTransport
ClientTransport
s are used by BayeuxClient
to send and receive Bayeux messages.Modifier and Type | Class and Description |
---|---|
static interface |
ClientTransport.Factory |
static interface |
ClientTransport.FailureHandler |
static class |
ClientTransport.FailureInfo |
Modifier and Type | Field and Description |
---|---|
static String |
JSON_CONTEXT_OPTION |
static String |
MAX_MESSAGE_SIZE_OPTION |
static String |
MAX_NETWORK_DELAY_OPTION |
static String |
MAX_SEND_BAYEUX_MESSAGE_SIZE_OPTION |
static String |
SCHEDULER_OPTION |
static String |
URL_OPTION |
Modifier | Constructor and Description |
---|---|
protected |
ClientTransport(String name,
String url,
Map<String,Object> options)
Deprecated.
|
protected |
ClientTransport(String name,
String url,
Map<String,Object> options,
ScheduledExecutorService scheduler) |
Modifier and Type | Method and Description |
---|---|
abstract 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. |
abstract boolean |
accept(String version) |
protected String |
generateJSON(List<Message.Mutable> messages) |
protected JSONContext.Client |
getJSONContextClient() |
long |
getMaxNetworkDelay() |
protected ScheduledExecutorService |
getScheduler() |
String |
getURL() |
void |
init() |
protected void |
initScheduler() |
protected List<Message.Mutable> |
parseMessages(String content) |
abstract void |
send(TransportListener listener,
List<Message.Mutable> messages) |
protected void |
setMaxNetworkDelay(long maxNetworkDelay) |
void |
setURL(String url) |
protected void |
shutdownScheduler() |
void |
terminate()
Terminates this transport, usually by closing network connections opened directly by this transport.
|
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefix
public static final String URL_OPTION
public static final String MAX_NETWORK_DELAY_OPTION
public static final String JSON_CONTEXT_OPTION
public static final String SCHEDULER_OPTION
public static final String MAX_SEND_BAYEUX_MESSAGE_SIZE_OPTION
public static final String MAX_MESSAGE_SIZE_OPTION
@Deprecated protected ClientTransport(String name, String url, Map<String,Object> options)
public String getURL()
public void setURL(String url)
public void init()
protected JSONContext.Client getJSONContextClient()
protected void initScheduler()
protected void shutdownScheduler()
protected ScheduledExecutorService getScheduler()
public abstract void abort(Throwable failure)
/meta/connect
s, without waiting for a response.failure
- the cause of the abortBayeuxClient.abort()
public void terminate()
ClientSession.disconnect()
public abstract boolean accept(String version)
public abstract void send(TransportListener listener, List<Message.Mutable> messages)
protected List<Message.Mutable> parseMessages(String content) throws ParseException
ParseException
protected String generateJSON(List<Message.Mutable> messages)
public long getMaxNetworkDelay()
protected void setMaxNetworkDelay(long maxNetworkDelay)
Copyright © 2008–2024 The CometD Project. All rights reserved.