public abstract class AbstractServerTransport extends AbstractTransport implements ServerTransport, org.eclipse.jetty.util.component.Dumpable
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
Performs server-to-client transport operations when a
/meta/connect
message is held and a server-side message is published. |
Modifier and Type | Field and Description |
---|---|
static String |
ALLOW_MESSAGE_DELIVERY_DURING_HANDSHAKE |
static String |
HANDSHAKE_RECONNECT_OPTION |
static String |
INTERVAL_OPTION |
static String |
JSON_CONTEXT_OPTION |
static String |
MAX_INTERVAL_OPTION |
static String |
MAX_LAZY_TIMEOUT_OPTION |
static String |
MAX_MESSAGE_SIZE_OPTION |
static String |
MAX_PROCESSING_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. |
getName, getOption, getOption, getOption, getOption, getOption, getOptionNames, getOptionPrefix, setOption, setOptionPrefix
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName, getOption, getOptionNames, getOptionPrefix
public static final String TIMEOUT_OPTION
public static final String INTERVAL_OPTION
public static final String MAX_INTERVAL_OPTION
public static final String MAX_PROCESSING_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
public static final String HANDSHAKE_RECONNECT_OPTION
public static final String ALLOW_MESSAGE_DELIVERY_DURING_HANDSHAKE
public static final String MAX_MESSAGE_SIZE_OPTION
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 long newMetaConnectCycle()
public long getInterval()
getInterval
in interface ServerTransport
public long getMaxInterval()
getMaxInterval
in interface ServerTransport
public long getMaxLazyTimeout()
getMaxLazyTimeout
in interface ServerTransport
public long getTimeout()
getTimeout
in interface ServerTransport
public boolean isMetaConnectDeliveryOnly()
isMetaConnectDeliveryOnly
in interface ServerTransport
public void setMetaConnectDeliveryOnly(boolean meta)
public boolean isHandshakeReconnect()
public void setHandshakeReconnect(boolean handshakeReconnect)
public boolean isAllowMessageDeliveryDuringHandshake()
public void setAllowMessageDeliveryDuringHandshake(boolean allow)
public int getMaxMessageSize()
public void setMaxMessageSize(int maxMessageSize)
public void init()
public void destroy()
protected JSONContextServer getJSONContextServer()
protected ServerMessage.Mutable[] parseMessages(BufferedReader reader, boolean jsonDebug) throws ParseException, IOException
ParseException
IOException
public ServerMessage.Mutable[] parseMessages(String json) throws ParseException
ParseException
public 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()
public void processReply(ServerSessionImpl session, ServerMessage.Mutable reply, Promise<ServerMessage.Mutable> promise)
protected String toJSON(ServerMessage msg)
public boolean allowMessageDeliveryDuringHandshake(ServerSessionImpl session)
public void scheduleExpiration(ServerSessionImpl session, long metaConnectCycle)
public void dump(Appendable out, String indent) throws IOException
dump
in interface org.eclipse.jetty.util.component.Dumpable
IOException
Copyright © 2008–2024 The CometD Project. All rights reserved.