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
FieldsModifier and TypeFieldDescriptionstatic final StringAttribute set on theServletContextduring the initialization phase.static final intFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionAcrossServletContextInitializer(org.springframework.context.ConfigurableApplicationContext applicationContext) -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()voidonApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) voidonStartup(jakarta.servlet.ServletContext servletContext) voidpostProcessBeanDefinitionRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry registry) voidpostProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Field Details
-
DYNAMIC_INITIALIZER
Attribute set on theServletContextduring 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:
getOrderin interfaceorg.springframework.core.Ordered
-
postProcessBeanDefinitionRegistry
public void postProcessBeanDefinitionRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry registry) throws org.springframework.beans.BeansException - Specified by:
postProcessBeanDefinitionRegistryin 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:
postProcessBeanFactoryin interfaceorg.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor- Specified by:
postProcessBeanFactoryin 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:
onStartupin interfaceorg.springframework.boot.web.servlet.ServletContextInitializer- Throws:
jakarta.servlet.ServletException
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) - Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
-