public class MMBaseContext extends Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static boolean |
htmlRootInitialized |
(package private) static String |
machineName
Name of the machine used in the mmbase cluster.
|
| Constructor and Description |
|---|
MMBaseContext() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getConfigPath()
Deprecated.
use
ResourceLoader.getConfigurationRoot() with relative path |
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()
Static version of
MMBase.getMachineName() |
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 |
isInitialized()
Returns whether this class has been initialized.
|
static DaemonThread |
startThread(DaemonTask task,
String name)
Deprecated.
|
static Thread |
startThread(Runnable task,
String name)
Starts a daemon thread using the MMBase thread group.
|
static boolean htmlRootInitialized
static String machineName
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 DaemonThread startThread(DaemonTask task, String name)
ThreadPools.scheduler.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 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()
MMBase.getMachineName()null if not yet determined.MMBase 1.9-SNAPSHOT - ${javadoctimestamp}