OortMulticastConfigServlet
, OortStaticConfigServlet
public abstract class OortConfigServlet
extends javax.servlet.http.HttpServlet
This servlet serves as a base class for initializing and configuring an
instance of the Oort
CometD cluster manager.
The following servlet init parameters are used to configure the Oort instance:
oort.url
, the absolute public URL to the CometD servletoort.secret
, the pre-shared secret that Oort servers use to authenticate
connections from other Oort cometsoort.channels
, a comma separated list of channels that
will be passed to Oort.observeChannel(String)
clientDebug
, a boolean that enables debugging of the
clients connected to other oort cluster managersOverride method newOort(BayeuxServer, String)
to return a customized
instance of Oort
.
SetiServlet
,
Serialized FormModifier and Type | Field | Description |
---|---|---|
protected static org.slf4j.Logger |
LOG |
|
static java.lang.String |
OORT_CHANNELS_PARAM |
|
static java.lang.String |
OORT_ENABLE_ACK_EXTENSION_PARAM |
|
static java.lang.String |
OORT_ENABLE_BINARY_EXTENSION_PARAM |
|
static java.lang.String |
OORT_JSON_CONTEXT_PARAM |
|
static java.lang.String |
OORT_SECRET_PARAM |
|
static java.lang.String |
OORT_URL_PARAM |
Constructor | Description |
---|---|
OortConfigServlet() |
Modifier and Type | Method | Description |
---|---|---|
protected abstract void |
configureCloud(javax.servlet.ServletConfig config,
Oort oort) |
Configures the Oort cloud by establishing connections with other Oort comets.
|
void |
destroy() |
|
void |
init(javax.servlet.ServletConfig config) |
|
protected Oort |
newOort(org.cometd.bayeux.server.BayeuxServer bayeux,
java.lang.String url) |
Creates and returns a new Oort instance.
|
protected java.lang.String |
provideOortURL() |
Retrieves the
oort.url parameter from this servlet init parameters. |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
public static final java.lang.String OORT_URL_PARAM
public static final java.lang.String OORT_SECRET_PARAM
public static final java.lang.String OORT_CHANNELS_PARAM
public static final java.lang.String OORT_ENABLE_ACK_EXTENSION_PARAM
public static final java.lang.String OORT_ENABLE_BINARY_EXTENSION_PARAM
public static final java.lang.String OORT_JSON_CONTEXT_PARAM
protected static final org.slf4j.Logger LOG
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
protected java.lang.String provideOortURL()
Retrieves the oort.url
parameter from this servlet init parameters.
Subclasses can override this method to compute the oort.url
parameter
dynamically, for example by retrieving the IP address of the host.
oort.url
parameterprotected Oort newOort(org.cometd.bayeux.server.BayeuxServer bayeux, java.lang.String url)
Creates and returns a new Oort instance.
bayeux
- the BayeuxServer instance to which the Oort instance should be associated tourl
- the oort.url
of the Oort instanceprotected abstract void configureCloud(javax.servlet.ServletConfig config, Oort oort) throws java.lang.Exception
Configures the Oort cloud by establishing connections with other Oort comets.
Subclasses implement their own strategy to discover and link with other comets.
config
- the servlet configuration to read parameters fromoort
- the Oort instance associated with this configuration servletjava.lang.Exception
- if the cloud configuration failspublic void destroy()
destroy
in class javax.servlet.GenericServlet
Copyright © 2008–2017 The CometD Project. All rights reserved.