|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.module.core.MMBaseContext
public class MMBaseContext
Using MMBaseContext class you can retrieve the servletContext from anywhere using the get method.
| Field Summary | |
|---|---|
(package private) static boolean |
htmlRootInitialized
|
(package private) static String |
machineName
Name of the machine used in the mmbase cluster. |
static int |
startTime
|
| Constructor Summary | |
|---|---|
MMBaseContext()
|
|
| Method Summary | |
|---|---|
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 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(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 boolean |
isShutdown()
|
static void |
shutdown()
|
static DaemonThread |
startThread(DaemonTask task,
String name)
Deprecated. Use ThreadPools.scheduler. |
static Thread |
startThread(Runnable task,
String name)
Starts a daemon thread using the MMBase thread group. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static boolean htmlRootInitialized
public static final int startTime
static String machineName
| Constructor Detail |
|---|
public MMBaseContext()
| Method Detail |
|---|
public static void init(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.
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 name
public static DaemonThread startThread(DaemonTask task,
String name)
ThreadPools.scheduler.
task - the task to run as a threadname - the thread's name
public static void initHtmlRoot()
throws ServletException
ServletException - if mmbase.htmlroot is not set or is not a
directorypublic static 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 path
File.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.public static void shutdown()
public static boolean isShutdown()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||