public class WebModuleUtil
extends java.lang.Object
| Constructor and Description | 
|---|
WebModuleUtil()  | 
| Modifier and Type | Method and Description | 
|---|---|
static java.util.Collection<ModuleFilterMapping> | 
getFilterMappings()
This method will return all Filter Mappings that have been registered by a module 
 | 
static java.util.Collection<javax.servlet.Filter> | 
getFilters()
This method will return all Filters that have been registered a module 
 | 
static java.util.List<javax.servlet.Filter> | 
getFiltersForRequest(javax.servlet.ServletRequest request)
Return List of Filters that have been loaded through Modules that have mappings that pass for
 the passed request 
 | 
static javax.servlet.http.HttpServlet | 
getServlet(java.lang.String servletName)
Finds the servlet defined by the servlet name 
 | 
static void | 
loadFilters(Module module,
           javax.servlet.ServletContext servletContext)
This method will initialize and store this module's filters 
 | 
static void | 
loadServlets(Module mod,
            javax.servlet.ServletContext servletContext)
This method will find and cache this module's servlets (so that it doesn't have to look them
 up every time) 
 | 
static org.springframework.web.context.support.XmlWebApplicationContext | 
refreshWAC(javax.servlet.ServletContext servletContext,
          boolean isOpenmrsStartup,
          Module startedModule)
Stops, closes, and refreshes the Spring context for the given  
servletContext | 
static void | 
setDispatcherServlet(DispatcherServlet ds)
Save the dispatcher servlet for use later (reinitializing things) 
 | 
static void | 
setDWRServlet(OpenmrsDWRServlet ds)
Save the dwr servlet for use later (reinitializing things) 
 | 
static void | 
shutdownModules(javax.servlet.ServletContext servletContext)
Reverses all activities done by startModule(org.openmrs.module.Module) Normal stop/shutdown
 is done by ModuleFactory 
 | 
static boolean | 
startModule(Module mod,
           javax.servlet.ServletContext servletContext,
           boolean delayContextRefresh)
Performs the webapp specific startup needs for modules Normal startup is done in
  
ModuleFactory.startModule(Module) If delayContextRefresh is true, the spring context
 is not rerun. | 
static void | 
stopModule(Module mod,
          javax.servlet.ServletContext servletContext)
Reverses all visible activities done by startModule(org.openmrs.module.Module) 
 | 
static void | 
unloadFilters(Module module)
This method will destroy and remove all filters that were registered by the passed
  
Module | 
static void | 
unloadServlets(Module mod)
Remove all of the servlets defined for this module 
 | 
public static boolean startModule(Module mod, javax.servlet.ServletContext servletContext, boolean delayContextRefresh)
ModuleFactory.startModule(Module) If delayContextRefresh is true, the spring context
 is not rerun. This will save a lot of time, but it also means that the calling method is
 responsible for restarting the context if necessary (the calling method will also have to
 call loadServlets(Module, ServletContext) and
 loadFilters(Module, ServletContext)).mod - Module to startServletContext - the current ServletContextdelayContextRefresh - true/false whether or not to do the context refreshpublic static void loadServlets(Module mod, javax.servlet.ServletContext servletContext)
mod - servletContext - the servlet contextpublic static void unloadServlets(Module mod)
mod - the module that is being stopped that needs its servlets removedpublic static void loadFilters(Module module, javax.servlet.ServletContext servletContext)
module - - The Module to load and register FiltersservletContext - - The servletContext within which this method is calledpublic static void unloadFilters(Module module)
Modulemodule - - The Module for which you want to remove and destroy filters.public static java.util.Collection<javax.servlet.Filter> getFilters()
Filters that have been registered by a modulepublic static java.util.Collection<ModuleFilterMapping> getFilterMappings()
ModuleFilterMappings that have been registered by a
         Modulepublic static java.util.List<javax.servlet.Filter> getFiltersForRequest(javax.servlet.ServletRequest request)
request - - The request to check for matching FiltersFilters that have filter mappings that match the passed requestpublic static void shutdownModules(javax.servlet.ServletContext servletContext)
public static void stopModule(Module mod, javax.servlet.ServletContext servletContext)
mod - servletContext - public static org.springframework.web.context.support.XmlWebApplicationContext refreshWAC(javax.servlet.ServletContext servletContext,
                                                                                          boolean isOpenmrsStartup,
                                                                                          Module startedModule)
servletContextservletContext - isOpenmrsStartup - if this refresh is being done at application startupstartedModule - the module that was just started and waiting on the context refreshpublic static void setDispatcherServlet(DispatcherServlet ds)
ds - public static void setDWRServlet(OpenmrsDWRServlet ds)
ds - public static javax.servlet.http.HttpServlet getServlet(java.lang.String servletName)
servletName - the name of the servlet out of the pathCopyright © 2018 OpenMRS Inc.. All Rights Reserved.