public abstract class ServerWebApp extends Server implements javax.servlet.ServletContextListener
Server
subclass that implements ServletContextListener
and uses its lifecycle to start and stop the server.Server.Status
CONF_SERVICES, CONF_SERVICES_EXT, CONF_STARTUP_STATUS, DEFAULT_LOG4J_PROPERTIES
Modifier | Constructor and Description |
---|---|
|
ServerWebApp(String name)
Constructor.
|
protected |
ServerWebApp(String name,
String homeDir,
org.apache.hadoop.conf.Configuration config)
Constructor for testing purposes.
|
protected |
ServerWebApp(String name,
String homeDir,
String configDir,
String logDir,
String tempDir,
org.apache.hadoop.conf.Configuration config)
Constructor for testing purposes.
|
Modifier and Type | Method and Description |
---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent event)
Destroys the
ServletContextListener which destroys
the Server. |
void |
contextInitialized(javax.servlet.ServletContextEvent event)
Initializes the
ServletContextListener which initializes
the Server. |
static void |
setHomeDirForCurrentThread(String homeDir)
Method for testing purposes.
|
checkServiceDependencies, destroy, destroyServices, ensureOperational, get, getConfig, getConfigDir, getHomeDir, getLogDir, getName, getPrefix, getPrefixedName, getStatus, getTempDir, init, initConfig, initLog, initServices, loadServices, setService, setStatus
protected ServerWebApp(String name, String homeDir, String configDir, String logDir, String tempDir, org.apache.hadoop.conf.Configuration config)
protected ServerWebApp(String name, String homeDir, org.apache.hadoop.conf.Configuration config)
public ServerWebApp(String name)
#SERVER_NAME#.home.dir
.
The config directory is looked in the Java System property
#SERVER_NAME#.config.dir
, if not defined it resolves to
the #SERVER_HOME_DIR#/conf
directory.
The log directory is looked in the Java System property
#SERVER_NAME#.log.dir
, if not defined it resolves to
the #SERVER_HOME_DIR#/log
directory.
The temp directory is looked in the Java System property
#SERVER_NAME#.temp.dir
, if not defined it resolves to
the #SERVER_HOME_DIR#/temp
directory.name
- server name.public static void setHomeDirForCurrentThread(String homeDir)
public void contextInitialized(javax.servlet.ServletContextEvent event)
ServletContextListener
which initializes
the Server.contextInitialized
in interface javax.servlet.ServletContextListener
event
- servelt context event.public void contextDestroyed(javax.servlet.ServletContextEvent event)
ServletContextListener
which destroys
the Server.contextDestroyed
in interface javax.servlet.ServletContextListener
event
- servelt context event.Copyright © 2014 Apache Software Foundation. All Rights Reserved.