public class JettyUtils
extends Object
Modifier and Type | Class and Description |
---|---|
static class |
JettyUtils.ServletParams<T> |
static class |
JettyUtils.ServletParams$ |
Constructor and Description |
---|
JettyUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addFilters(scala.collection.Seq<org.eclipse.jetty.servlet.ServletContextHandler> handlers,
SparkConf conf)
Add filters, if any, to the given list of ServletContextHandlers
|
static org.eclipse.jetty.servlet.ServletContextHandler |
createRedirectHandler(String srcPath,
String destPath,
scala.Function1<javax.servlet.http.HttpServletRequest,scala.runtime.BoxedUnit> beforeRedirect,
String basePath,
scala.collection.immutable.Set<String> httpMethods)
Create a handler that always redirects the user to the given path
|
static <T> javax.servlet.http.HttpServlet |
createServlet(JettyUtils.ServletParams<T> servletParams,
org.apache.spark.SecurityManager securityMgr,
SparkConf conf,
scala.Function1<T,Object> evidence$2) |
static org.eclipse.jetty.servlet.ServletContextHandler |
createServletHandler(String path,
javax.servlet.http.HttpServlet servlet,
String basePath)
Create a context handler that responds to a request with the given path prefix
|
static <T> org.eclipse.jetty.servlet.ServletContextHandler |
createServletHandler(String path,
JettyUtils.ServletParams<T> servletParams,
org.apache.spark.SecurityManager securityMgr,
SparkConf conf,
String basePath,
scala.Function1<T,Object> evidence$3)
Create a context handler that responds to a request with the given path prefix
|
static org.eclipse.jetty.servlet.ServletContextHandler |
createStaticHandler(String resourceBase,
String path)
Create a handler for serving files from a static directory
|
static JettyUtils.ServletParams<scala.collection.Seq<scala.xml.Node>> |
htmlResponderToServlet(scala.Function1<javax.servlet.http.HttpServletRequest,scala.collection.Seq<scala.xml.Node>> responder) |
static JettyUtils.ServletParams<org.json4s.JsonAST.JValue> |
jsonResponderToServlet(scala.Function1<javax.servlet.http.HttpServletRequest,org.json4s.JsonAST.JValue> responder) |
static org.apache.spark.ui.ServerInfo |
startJettyServer(String hostName,
int port,
org.apache.spark.SSLOptions sslOptions,
scala.collection.Seq<org.eclipse.jetty.servlet.ServletContextHandler> handlers,
SparkConf conf,
String serverName)
Attempt to start a Jetty server bound to the supplied hostName:port using the given
context handlers.
|
static JettyUtils.ServletParams<String> |
textResponderToServlet(scala.Function1<javax.servlet.http.HttpServletRequest,String> responder) |
public static JettyUtils.ServletParams<org.json4s.JsonAST.JValue> jsonResponderToServlet(scala.Function1<javax.servlet.http.HttpServletRequest,org.json4s.JsonAST.JValue> responder)
public static JettyUtils.ServletParams<scala.collection.Seq<scala.xml.Node>> htmlResponderToServlet(scala.Function1<javax.servlet.http.HttpServletRequest,scala.collection.Seq<scala.xml.Node>> responder)
public static JettyUtils.ServletParams<String> textResponderToServlet(scala.Function1<javax.servlet.http.HttpServletRequest,String> responder)
public static <T> javax.servlet.http.HttpServlet createServlet(JettyUtils.ServletParams<T> servletParams, org.apache.spark.SecurityManager securityMgr, SparkConf conf, scala.Function1<T,Object> evidence$2)
public static <T> org.eclipse.jetty.servlet.ServletContextHandler createServletHandler(String path, JettyUtils.ServletParams<T> servletParams, org.apache.spark.SecurityManager securityMgr, SparkConf conf, String basePath, scala.Function1<T,Object> evidence$3)
public static org.eclipse.jetty.servlet.ServletContextHandler createServletHandler(String path, javax.servlet.http.HttpServlet servlet, String basePath)
public static org.eclipse.jetty.servlet.ServletContextHandler createRedirectHandler(String srcPath, String destPath, scala.Function1<javax.servlet.http.HttpServletRequest,scala.runtime.BoxedUnit> beforeRedirect, String basePath, scala.collection.immutable.Set<String> httpMethods)
public static org.eclipse.jetty.servlet.ServletContextHandler createStaticHandler(String resourceBase, String path)
public static void addFilters(scala.collection.Seq<org.eclipse.jetty.servlet.ServletContextHandler> handlers, SparkConf conf)
public static org.apache.spark.ui.ServerInfo startJettyServer(String hostName, int port, org.apache.spark.SSLOptions sslOptions, scala.collection.Seq<org.eclipse.jetty.servlet.ServletContextHandler> handlers, SparkConf conf, String serverName)
If the desired port number is contended, continues incrementing ports until a free port is found. Return the jetty Server object, the chosen port, and a mutable collection of handlers.
hostName
- (undocumented)port
- (undocumented)sslOptions
- (undocumented)handlers
- (undocumented)conf
- (undocumented)serverName
- (undocumented)