public class MMBaseContext extends Object implements javax.servlet.ServletContextListener
MMBaseContext before MMBase 2.0).| Modifier and Type | Field and Description |
|---|---|
static Logger |
INITLOG |
static int |
startTime |
| Constructor and Description |
|---|
MMBaseContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent sce) |
void |
contextInitialized(javax.servlet.ServletContextEvent sce) |
static String |
getConfigPath()
Deprecated.
use
ResourceLoader.getConfigurationRoot() with relative path |
static File |
getDataDir() |
static String |
getEncoding() |
static String |
getHost()
The host or ip number of the machine this module is
running on.
|
static String |
getHtmlRoot()
Returns a string representing the mmbase.htmlroot parameter without a
final
File.separator. |
static String |
getHtmlRootUrlPath()
Returns a string representing the HtmlRootUrlPath, this is the path under
the webserver, what is the root for this instance.
|
static String |
getMachineName()
Returns the unique identifier for the MMBase instance.
|
static String |
getOutputFile()
Deprecated.
use logging system
|
static javax.servlet.ServletContext |
getServletContext()
Returns the
ServletContext used to initialize MMBase. |
static ThreadGroup |
getThreadGroup()
Returns the MMBase thread group.
|
static void |
init()
Initialize MMBase using system properties only.
|
static void |
init(javax.servlet.ServletContext servletContext)
Initialize MMBase using a
ServletContext. |
static void |
init(String configPath,
boolean initLogging)
Initialize MMBase using a config path.
|
static void |
initHtmlRoot()
Initialize mmbase.htmlroot parameter.
|
static boolean |
isHtmlRootInitialized() |
static boolean |
isInitialized()
Returns whether this class has been initialized.
|
static boolean |
isShutdown() |
static void |
setDataDir(String setting) |
static void |
setEncoding(String e) |
static void |
setHost(String h) |
static void |
setMachineName(String nm) |
static void |
shutdown() |
static Thread |
startThread(Runnable task,
String name)
Starts a daemon thread using the MMBase thread group.
|
public static final Logger INITLOG
public static final int startTime
public static void init(javax.servlet.ServletContext servletContext)
ServletContext. This method will
check the servlet configuration for context parameters mmbase.outputfile
and mmbase.config. If not found it will look for system
properties.javax.servlet.ServletException - if mmbase.config is not set or is not a
directory or doesn't contain the expected
config files.public static void init(String configPath, boolean initLogging) throws Exception
Exception - if mmbase.config is not set or is not a
directory or doesn't contain the expected
config files.public static void init()
throws Exception
Exception - if mmbase.config is not set or is not a
directory or doesn't contain the expected
config files.public static ThreadGroup getThreadGroup()
public static Thread startThread(Runnable task, String name)
task - the task to run as a threadname - the thread's namepublic static void initHtmlRoot()
throws javax.servlet.ServletException
javax.servlet.ServletException - if mmbase.htmlroot is not set or is not a
directorypublic static javax.servlet.ServletContext getServletContext()
ServletContext used to initialize MMBase.
Before calling this method the init method should be called.ServletContext used to initialize MMBase or
null if MMBase was initialized without
ServletContextpublic static String getConfigPath()
ResourceLoader.getConfigurationRoot() with relative pathFile.separator. Before calling this method the
init method should be called to make sure this parameter is set.public static String getHtmlRoot()
File.separator. Before calling this method the
initHtmlRoot method should be called to make sure this parameter is set.null if not
initializedpublic static boolean isHtmlRootInitialized()
public static String getOutputFile()
System.out and
System.err output is redirected. Before calling this method
the init method should be called.null if not setpublic static String getHtmlRootUrlPath()
getServletContext().getContextPath() +
"/", so this also ends in a /public static boolean isInitialized()
public static String getMachineName()
null if not yet determined.public static void setMachineName(String nm)
public static void shutdown()
public static boolean isShutdown()
public static String getEncoding()
public static void setEncoding(String e)
public static String getHost()
public static void setHost(String h)
public static File getDataDir()
public static void setDataDir(String setting)
public void contextDestroyed(javax.servlet.ServletContextEvent sce)
contextDestroyed in interface javax.servlet.ServletContextListenerpublic void contextInitialized(javax.servlet.ServletContextEvent sce)
contextInitialized in interface javax.servlet.ServletContextListenerMMBase2 Utils 2.0.0 - 2019-08-08T23:20