Package com.foreach.across.config
Class AcrossServletContextInitializer
java.lang.Object
com.foreach.across.config.AcrossServletContextInitializer
- All Implemented Interfaces:
EventListener
,org.springframework.beans.factory.config.BeanFactoryPostProcessor
,org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
,org.springframework.boot.web.servlet.ServletContextInitializer
,org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
,org.springframework.core.Ordered
public class AcrossServletContextInitializer
extends Object
implements org.springframework.boot.web.servlet.ServletContextInitializer, org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>, org.springframework.core.Ordered
ServletContextInitializer
that ensures that the AcrossContext
is bootstrapped before the
ServletContext
is fully initialized. This is required for dynamic registration of filters and servlets.- Since:
- 1.1.2
- Author:
- Arne Vandamme
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Attribute set on theServletContext
during the initialization phase.static final int
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionAcrossServletContextInitializer
(org.springframework.context.ConfigurableApplicationContext applicationContext) -
Method Summary
Modifier and TypeMethodDescriptionint
getOrder()
void
onApplicationEvent
(org.springframework.context.event.ContextRefreshedEvent event) void
onStartup
(jakarta.servlet.ServletContext servletContext) void
postProcessBeanDefinitionRegistry
(org.springframework.beans.factory.support.BeanDefinitionRegistry registry) void
postProcessBeanFactory
(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Field Details
-
DYNAMIC_INITIALIZER
Attribute set on theServletContext
during the initialization phase. Can be used to detect if it is still possible to register servlets or filters on the context.- See Also:
-
LISTENER_ORDER
public static final int LISTENER_ORDER- See Also:
-
-
Constructor Details
-
AcrossServletContextInitializer
public AcrossServletContextInitializer(org.springframework.context.ConfigurableApplicationContext applicationContext)
-
-
Method Details
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
postProcessBeanDefinitionRegistry
public void postProcessBeanDefinitionRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry registry) throws org.springframework.beans.BeansException - Specified by:
postProcessBeanDefinitionRegistry
in interfaceorg.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
- Throws:
org.springframework.beans.BeansException
-
postProcessBeanFactory
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) throws org.springframework.beans.BeansException - Specified by:
postProcessBeanFactory
in interfaceorg.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
- Specified by:
postProcessBeanFactory
in interfaceorg.springframework.beans.factory.config.BeanFactoryPostProcessor
- Throws:
org.springframework.beans.BeansException
-
onStartup
public void onStartup(jakarta.servlet.ServletContext servletContext) throws jakarta.servlet.ServletException - Specified by:
onStartup
in interfaceorg.springframework.boot.web.servlet.ServletContextInitializer
- Throws:
jakarta.servlet.ServletException
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) - Specified by:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
-