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 and Description |
---|---|
static String |
OORT_CHANNELS_PARAM |
static String |
OORT_CLIENT_TRANSPORT_FACTORIES_PARAM |
static String |
OORT_ENABLE_ACK_EXTENSION_PARAM |
static String |
OORT_ENABLE_BINARY_EXTENSION_PARAM |
static String |
OORT_JSON_CONTEXT_PARAM |
static String |
OORT_SECRET_PARAM |
static String |
OORT_URL_PARAM |
Constructor and Description |
---|
OortConfigServlet() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
configureCloud(javax.servlet.ServletConfig config,
Oort oort)
Configures the Oort cloud by establishing connections with other Oort comets.
|
protected void |
configureOort(javax.servlet.ServletConfig config,
Oort oort)
Configures the Oort instance with servlet init parameters.
|
void |
destroy() |
void |
init(javax.servlet.ServletConfig config) |
protected Oort |
newOort(BayeuxServer bayeux,
String url)
Creates and returns a new Oort instance.
|
protected String |
provideOortURL()
Retrieves the
oort.url parameter from this servlet init parameters. |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
public static final String OORT_URL_PARAM
public static final String OORT_SECRET_PARAM
public static final String OORT_CHANNELS_PARAM
public static final String OORT_ENABLE_ACK_EXTENSION_PARAM
public static final String OORT_ENABLE_BINARY_EXTENSION_PARAM
public static final String OORT_JSON_CONTEXT_PARAM
public static final String OORT_CLIENT_TRANSPORT_FACTORIES_PARAM
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
protected 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(BayeuxServer bayeux, 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 void configureOort(javax.servlet.ServletConfig config, Oort oort) throws Exception
Configures the Oort instance with servlet init parameters.
config
- the Servlet configurationoort
- the Oort instance to configureException
- if the Oort instance cannot be configuredprotected abstract void configureCloud(javax.servlet.ServletConfig config, Oort oort) throws 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 servletException
- if the cloud configuration failspublic void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
Copyright © 2008–2024 The CometD Project. All rights reserved.