public class WebAppInitUtil extends Object
WebAppInitializer
to dynamically initialize the web
application. WebAppInitializer
can be registered as initialization-parameters in the
web.xml. The order of the WebAppInitializer classes can be specified by the initialization
parameter 'INIT_ORDER'.Constructor and Description |
---|
WebAppInitUtil() |
Modifier and Type | Method and Description |
---|---|
void |
contextDestroyed(ServletContextEvent sce)
Is called when is the server / the application is shut down.
|
void |
contextInitialized(ServletContextEvent sce)
Is called when the server / the application is started.
|
WebAppInitializer |
getInitializer(String name)
Returns the WebAppInitializer by the given name if existing, null otherwise.
|
static WebAppInitUtil |
getInstance()
Returns the instance of this WebAppInitUtil.
|
protected void |
loadInitilizers(ServletContext c)
Loads the registered initializers as given as initialization parameters in web.xml.
|
WebAppInitUtil |
removeInitializer(String name)
Removes the WebAppInitializer by the given name if existing.
|
WebAppInitUtil |
setInitializer(String name,
WebAppInitializer webAppInitializer)
Sets the given WebAppInitializer by the given name if not already existing.
|
public static WebAppInitUtil getInstance()
public WebAppInitializer getInitializer(String name) throws Exception
name
- The name of the WebAppInitializer to get.Exception
- if this WebAppInitUtil was not initialized by the servlet container yet.public WebAppInitUtil setInitializer(String name, WebAppInitializer webAppInitializer) throws Exception
name
- The name of the WebAppInitializer to set.webAppInitializer
- The WebAppInitializer to set.Exception
- if this WebAppInitUtil was not initialized by the servlet container yet.public WebAppInitUtil removeInitializer(String name) throws Exception
name
- The name of the WebAppInitializer to remove.Exception
- if this WebAppInitUtil was not initialized by the servlet container yet.protected void loadInitilizers(ServletContext c)
c
- The ServletContextpublic void contextInitialized(ServletContextEvent sce)
onWepAppInit
on all registered WebAppInitializers.sce
- The ServletContextEvent.public void contextDestroyed(ServletContextEvent sce)
onWepAppDestroy
on all registered WebAppInitializers.sce
- The ServletContextEvent.Copyright © 2016 SAPERION AG. All rights reserved.