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
Modifier 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(com.foreach.across.core.AcrossContext context) void
configureModule
(com.foreach.across.core.context.bootstrap.ModuleBootstrapConfig moduleConfiguration) void
onApplicationEvent
(org.springframework.cloud.context.environment.EnvironmentChangeEvent event) void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.foreach.across.core.context.bootstrap.AcrossBootstrapConfigurer
configureContext
Methods 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:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
configure
public void configure(com.foreach.across.core.AcrossContext context) - Specified by:
configure
in interfacecom.foreach.across.config.AcrossContextConfigurer
-
configureModule
public void configureModule(com.foreach.across.core.context.bootstrap.ModuleBootstrapConfig moduleConfiguration) - Specified by:
configureModule
in interfacecom.foreach.across.core.context.bootstrap.AcrossBootstrapConfigurer
-
onApplicationEvent
public void onApplicationEvent(org.springframework.cloud.context.environment.EnvironmentChangeEvent event) - Specified by:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<org.springframework.cloud.context.environment.EnvironmentChangeEvent>
-