public static class ContainerInitializer.ServletContainerInitializerServletContextListener extends Object implements ServletContextListener
Constructor and Description |
---|
ServletContainerInitializerServletContextListener(ServletContainerInitializer sci) |
Modifier and Type | Method and Description |
---|---|
ContainerInitializer.ServletContainerInitializerServletContextListener |
addClasses(Class<?>... classes)
Add classes to be passed to the
ServletContainerInitializer.onStartup(Set, ServletContext) call. |
ContainerInitializer.ServletContainerInitializerServletContextListener |
addClasses(String... classNames)
Add classes to be passed to the
ServletContainerInitializer.onStartup(Set, ServletContext) call. |
ContainerInitializer.ServletContainerInitializerServletContextListener |
afterStartup(Consumer<ServletContext> consumer)
Add a optional consumer to execute once the
ServletContainerInitializer.onStartup(Set, ServletContext) has
been called successfully. |
void |
contextDestroyed(ServletContextEvent sce) |
void |
contextInitialized(ServletContextEvent sce) |
Set<Class<?>> |
getClasses() |
public ServletContainerInitializerServletContextListener(ServletContainerInitializer sci)
public ContainerInitializer.ServletContainerInitializerServletContextListener addClasses(String... classNames)
ServletContainerInitializer.onStartup(Set, ServletContext)
call.
Note that these classes will be loaded using the context classloader for the ServletContext initialization phase.
classNames
- the class names to load and pass into the ServletContainerInitializer.onStartup(Set, ServletContext)
callContainerInitializer.ServletContainerInitializerServletContextListener
instance.public ContainerInitializer.ServletContainerInitializerServletContextListener addClasses(Class<?>... classes)
ServletContainerInitializer.onStartup(Set, ServletContext)
call.
Note that these classes will exist on the classloader that was used to call this method.
If you want the classes to be loaded using the context classloader for the ServletContext
then use the String form of the classes via the addClasses(String...)
method.
classes
- the classes to pass into the ServletContainerInitializer.onStartup(Set, ServletContext)
callContainerInitializer.ServletContainerInitializerServletContextListener
instance.public ContainerInitializer.ServletContainerInitializerServletContextListener afterStartup(Consumer<ServletContext> consumer)
ServletContainerInitializer.onStartup(Set, ServletContext)
has
been called successfully.
This would be for actions to perform on a ServletContext once this specific SCI has completed its execution. Actions that would require specific configurations that the SCI provides to be present on the ServletContext to function properly.
This consumer is typically used for Embedded Jetty users to configure Jetty for their specific needs.
consumer
- the consumer to execute after the SCI has executedContainerInitializer.ServletContainerInitializerServletContextListener
instance.public void contextInitialized(ServletContextEvent sce)
contextInitialized
in interface ServletContextListener
public void contextDestroyed(ServletContextEvent sce)
contextDestroyed
in interface ServletContextListener
Copyright © 2010 - 2020 Adobe. All Rights Reserved