|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.mmbase.util.MMBaseContext
public class MMBaseContext
Using MMBaseContext class you can retrieve the servletContext from anywhere
using the get method. (This class used to be MMBaseContext before MMBase 2.0).
| Field Summary | |
|---|---|
static Logger |
INITLOG
|
static int |
startTime
|
| Constructor Summary | |
|---|---|
MMBaseContext()
|
|
| Method Summary | |
|---|---|
void |
contextDestroyed(ServletContextEvent sce)
|
void |
contextInitialized(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 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 |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Logger INITLOG
public static final int startTime
| 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 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 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(ServletContextEvent sce)
contextDestroyed in interface ServletContextListenerpublic void contextInitialized(ServletContextEvent sce)
contextInitialized in interface ServletContextListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||