Package com.foreach.across.autoconfigure
Class CloudRefreshAutoConfigurationAdapter
java.lang.Object
com.foreach.across.autoconfigure.CloudRefreshAutoConfigurationAdapter
- All Implemented Interfaces:
com.foreach.across.config.AcrossContextConfigurer,com.foreach.across.core.context.bootstrap.AcrossBootstrapConfigurer,EventListener,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener<org.springframework.cloud.context.environment.EnvironmentChangeEvent>
@Configuration
@ConditionalOnClass({org.springframework.cloud.autoconfigure.RefreshAutoConfiguration.class,org.springframework.cloud.context.scope.refresh.RefreshScope.class})
@Import(org.springframework.cloud.autoconfigure.RefreshAutoConfiguration.class)
public class CloudRefreshAutoConfigurationAdapter
extends Object
implements com.foreach.across.config.AcrossContextConfigurer, org.springframework.context.ApplicationContextAware, com.foreach.across.core.context.bootstrap.AcrossBootstrapConfigurer, org.springframework.context.ApplicationListener<org.springframework.cloud.context.environment.EnvironmentChangeEvent>
Adapts Spring Cloud refresh support for an Across application.
This class injects support for the
RefreshScope in the Across context itself,
as well as in every Across module. It also acts as an application listener for the
EnvironmentChangeEvent and implements custom code for refreshing the Across
context beans and updating the module environments when a change event happens.- Since:
- 1.0.0
- Author:
- Arne Vandamme
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class -
Field Summary
Fields inherited from interface com.foreach.across.core.context.bootstrap.AcrossBootstrapConfigurer
CONTEXT_INFRASTRUCTURE_MODULE, CONTEXT_POSTPROCESSOR_MODULE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(com.foreach.across.core.AcrossContext context) voidconfigureModule(com.foreach.across.core.context.bootstrap.ModuleBootstrapConfig moduleConfiguration) voidonApplicationEvent(org.springframework.cloud.context.environment.EnvironmentChangeEvent event) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.foreach.across.core.context.bootstrap.AcrossBootstrapConfigurer
configureContextMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Constructor Details
-
CloudRefreshAutoConfigurationAdapter
public CloudRefreshAutoConfigurationAdapter()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
configure
public void configure(com.foreach.across.core.AcrossContext context) - Specified by:
configurein interfacecom.foreach.across.config.AcrossContextConfigurer
-
configureModule
public void configureModule(com.foreach.across.core.context.bootstrap.ModuleBootstrapConfig moduleConfiguration) - Specified by:
configureModulein interfacecom.foreach.across.core.context.bootstrap.AcrossBootstrapConfigurer
-
onApplicationEvent
public void onApplicationEvent(org.springframework.cloud.context.environment.EnvironmentChangeEvent event) - Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.cloud.context.environment.EnvironmentChangeEvent>
-