public abstract class AbstractServerTransport extends AbstractTransport implements ServerTransport
The base class of all server transports.
Each derived Transport class should declare all options that it supports
by calling AbstractTransport.setOption(String, Object) for each option.
Then during the call the init(), each transport should
call the variants of AbstractTransport.getOption(String) to obtained the configured
value for the option.
| Modifier and Type | Class and Description |
|---|---|
static interface |
AbstractServerTransport.Scheduler |
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
_logger |
static String |
INTERVAL_OPTION |
static String |
JSON_CONTEXT_OPTION |
static String |
MAX_INTERVAL_OPTION |
static String |
MAX_LAZY_TIMEOUT_OPTION |
static String |
MAX_QUEUE_OPTION |
static String |
META_CONNECT_DELIVERY_OPTION |
static String |
TIMEOUT_OPTION |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractServerTransport(BayeuxServerImpl bayeux,
String name)
The constructor is passed the
BayeuxServerImpl instance for
the transport. |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
Object |
getAdvice() |
BayeuxServerImpl |
getBayeux() |
long |
getInterval() |
long |
getMaxInterval() |
long |
getMaxLazyTimeout() |
long |
getTimeout() |
void |
init()
Initializes the transport, resolving default and direct options.
|
boolean |
isMetaConnectDeliveryOnly() |
protected ServerMessage.Mutable[] |
parseMessages(BufferedReader reader,
boolean jsonDebug) |
protected ServerMessage.Mutable[] |
parseMessages(String json) |
void |
setInterval(long interval) |
void |
setMaxInterval(long maxInterval) |
void |
setMaxLazyTimeout(long maxLazyTimeout) |
void |
setMetaConnectDeliveryOnly(boolean meta) |
void |
setTimeout(long timeout) |
protected void |
sweep()
Housekeeping sweep, called a regular intervals
|
protected byte[] |
toJSONBytes(ServerMessage message,
String encoding) |
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefixclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetContextgetName, getOption, getOptionNames, getOptionPrefixpublic static final String TIMEOUT_OPTION
public static final String INTERVAL_OPTION
public static final String MAX_INTERVAL_OPTION
public static final String MAX_LAZY_TIMEOUT_OPTION
public static final String META_CONNECT_DELIVERY_OPTION
public static final String MAX_QUEUE_OPTION
public static final String JSON_CONTEXT_OPTION
protected final org.slf4j.Logger _logger
protected AbstractServerTransport(BayeuxServerImpl bayeux, String name)
The constructor is passed the BayeuxServerImpl instance for
the transport. The BayeuxServerImpl.getOptions() map is
populated with the default options known by this transport. The options
are then inspected again when init() is called, to set the
actual values used. The options are arranged into a naming hierarchy
by derived classes adding prefix by calling add AbstractTransport.setOptionPrefix(String).
Calls to AbstractTransport.getOption(String) will use the list of prefixes
to search for the most specific option set.
bayeux - the BayeuxServer implementationname - the name of the transportpublic Object getAdvice()
getAdvice in interface ServerTransportpublic long getInterval()
getInterval in interface ServerTransportpublic long getMaxInterval()
getMaxInterval in interface ServerTransportpublic long getMaxLazyTimeout()
getMaxLazyTimeout in interface ServerTransportpublic long getTimeout()
getTimeout in interface ServerTransportpublic boolean isMetaConnectDeliveryOnly()
isMetaConnectDeliveryOnly in interface ServerTransportpublic void setMetaConnectDeliveryOnly(boolean meta)
public void init()
public void destroy()
protected ServerMessage.Mutable[] parseMessages(BufferedReader reader, boolean jsonDebug) throws ParseException, IOException
ParseExceptionIOExceptionprotected ServerMessage.Mutable[] parseMessages(String json) throws ParseException
ParseExceptionpublic BayeuxServerImpl getBayeux()
public void setInterval(long interval)
interval - the interval in millisecondspublic void setMaxInterval(long maxInterval)
maxInterval - the maxInterval in millisecondspublic void setTimeout(long timeout)
timeout - the timeout in millisecondspublic void setMaxLazyTimeout(long maxLazyTimeout)
maxLazyTimeout - the maxLazyTimeout in millisecondsprotected void sweep()
protected byte[] toJSONBytes(ServerMessage message, String encoding)
Copyright © 2008–2015 Dojo Foundation. All rights reserved.