public final class Listener
extends org.springframework.web.context.ContextLoader
implements javax.servlet.ServletContextListener, javax.servlet.http.HttpSessionListener
Constructor and Description |
---|
Listener() |
Modifier and Type | Method and Description |
---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent event)
Called when the webapp is shut down properly Must call Context.shutdown() and then shutdown
all the web layers of the modules
|
void |
contextInitialized(javax.servlet.ServletContextEvent event)
This method is called when the servlet context is initialized(when the Web Application is
deployed).
|
static boolean |
errorOccurredAtStartup()
Boolean flag set by the
contextInitialized(ServletContextEvent) method if an error
occurred when trying to start up. |
static Throwable |
getErrorAtStartup()
Get the error thrown at startup
|
static Properties |
getRuntimeProperties()
Finds and loads the runtime properties
|
static boolean |
isOpenmrsStarted()
Boolean flag that tells if OpenMRS is started and ready to handle requests via REST.
|
static boolean |
isSetupNeeded()
Boolean flag that tells if we need to run the database setup wizard.
|
static void |
loadBundledModules(javax.servlet.ServletContext servletContext)
Load the pre-packaged modules from web/WEB-INF/bundledModules.
|
static void |
performWebStartOfModules(Collection<Module> startedModules,
javax.servlet.ServletContext servletContext) |
static void |
performWebStartOfModules(javax.servlet.ServletContext servletContext)
Call WebModuleUtil.startModule on each started module
|
static boolean |
runtimePropertiesFound()
Boolean flag set on webapp startup marking whether there is a runtime properties file or not.
|
void |
sessionCreated(javax.servlet.http.HttpSessionEvent se)
This gets all Spring components that implement HttpSessionListener
and passes the HttpSession event to them whenever an HttpSession is created
|
void |
sessionDestroyed(javax.servlet.http.HttpSessionEvent se)
This gets all Spring components that implement HttpSessionListener
and passes the HttpSession event to them whenever an HttpSession is destroyed
|
static void |
setErrorAtStartup(Throwable errorAtStartup) |
static void |
setRuntimePropertiesFound(boolean runtimePropertiesFound) |
static void |
startOpenmrs(javax.servlet.ServletContext servletContext)
Do the work of starting openmrs.
|
closeWebApplicationContext, configureAndRefreshWebApplicationContext, createWebApplicationContext, customizeContext, determineContextClass, determineContextInitializerClasses, getCurrentWebApplicationContext, initWebApplicationContext, loadParentContext, setContextInitializers
public static boolean runtimePropertiesFound()
InitializationFilter
takes over any openmrs url and
redirects to the WebConstants.SETUP_PAGE_URL
public static boolean errorOccurredAtStartup()
contextInitialized(ServletContextEvent)
method if an error
occurred when trying to start up. The StartupErrorFilter displays the error to the adminpublic static boolean isSetupNeeded()
public static boolean isOpenmrsStarted()
public static Throwable getErrorAtStartup()
public static void setRuntimePropertiesFound(boolean runtimePropertiesFound)
public static void setErrorAtStartup(Throwable errorAtStartup)
public void sessionCreated(javax.servlet.http.HttpSessionEvent se)
sessionCreated
in interface javax.servlet.http.HttpSessionListener
HttpSessionListener.sessionCreated(HttpSessionEvent)
public void sessionDestroyed(javax.servlet.http.HttpSessionEvent se)
sessionDestroyed
in interface javax.servlet.http.HttpSessionListener
HttpSessionListener.sessionDestroyed(HttpSessionEvent)
public void contextInitialized(javax.servlet.ServletContextEvent event)
contextInitialized
in interface javax.servlet.ServletContextListener
event
- public static void startOpenmrs(javax.servlet.ServletContext servletContext) throws javax.servlet.ServletException
servletContext
- javax.servlet.ServletException
public static void loadBundledModules(javax.servlet.ServletContext servletContext)
servletContext
- the current servlet context for the webapppublic void contextDestroyed(javax.servlet.ServletContextEvent event)
contextDestroyed
in interface javax.servlet.ServletContextListener
ContextLoaderListener.contextDestroyed(javax.servlet.ServletContextEvent)
public static Properties getRuntimeProperties()
OpenmrsUtil.getRuntimeProperties(String)
public static void performWebStartOfModules(javax.servlet.ServletContext servletContext) throws ModuleMustStartException, Exception
servletContext
- ModuleMustStartException
- if the context cannot restart due to a
MandatoryModuleException
or OpenmrsCoreModuleException
Exception
public static void performWebStartOfModules(Collection<Module> startedModules, javax.servlet.ServletContext servletContext) throws ModuleMustStartException, Exception
ModuleMustStartException
Exception
Copyright © 2024 OpenMRS Inc.. All rights reserved.