@WebListener public class WuicServletContextListener extends Object implements ServletContextListener
Servlet context listener that injects into the ServletContext
the WuicFacade
as an
attribute mapped to ApplicationConfig.WEB_WUIC_FACADE
name.
Modifier and Type | Class and Description |
---|---|
static class |
WuicServletContextListener.InitParamProperties
A class that retrieves properties from init-param configured inside a servlet context.
|
static class |
WuicServletContextListener.PropertiesWrapper
A properties that delegate call to a wrapped instance and modify the value associated to
ApplicationConfig.WUIC_SERVLET_CONTEXT_PARAM to make sure it starts with the servlet
context's path. |
Constructor and Description |
---|
WuicServletContextListener() |
Modifier and Type | Method and Description |
---|---|
void |
contextDestroyed(ServletContextEvent sce) |
void |
contextInitialized(ServletContextEvent sce) |
static BiFunction<String,String,String> |
getParamProvider(ServletContext servletContext)
Gets the
BiFunction providing parameters.. |
static WuicFacade |
getWuicFacade(ServletContext servletContext)
Gets the
WuicFacade injected into the given context. |
protected BiFunction<String,String,String> |
paramProvider(ServletContext sc)
Returns the function the
WuicFacadeBuilder will use to retrieve properties. |
public static WuicFacade getWuicFacade(ServletContext servletContext)
Gets the WuicFacade
injected into the given context.
servletContext
- the context that must contains the facadepublic static BiFunction<String,String,String> getParamProvider(ServletContext servletContext)
Gets the BiFunction
providing parameters..
servletContext
- the context that must contains the functionpublic void contextInitialized(ServletContextEvent sce)
contextInitialized
in interface ServletContextListener
public void contextDestroyed(ServletContextEvent sce)
contextDestroyed
in interface ServletContextListener
protected BiFunction<String,String,String> paramProvider(ServletContext sc)
Returns the function the WuicFacadeBuilder
will use to retrieve properties.
sc
- the servlet contextCopyright © 2012-2015. All Rights Reserved.