Package io.microsphere.spring.context
Class ConfigurableApplicationContextInitializer
java.lang.Object
io.microsphere.spring.context.ConfigurableApplicationContextInitializer
- All Implemented Interfaces:
org.springframework.context.ApplicationContextInitializer<org.springframework.context.ConfigurableApplicationContext>
- Direct Known Subclasses:
EventPublishingBeanInitializer,ListenableAutowireCandidateResolverInitializer,ListenableConfigurableEnvironmentInitializer
public abstract class ConfigurableApplicationContextInitializer
extends Object
implements org.springframework.context.ApplicationContextInitializer<org.springframework.context.ConfigurableApplicationContext>
Abstract class of
ApplicationContextInitializer for ConfigurableApplicationContext, which can be
enabled or disabled by configuration properties.- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
-
ApplicationContextInitializerConfigurableApplicationContextConfigurableEnvironment
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanGet the default value of enabledprotected StringGet the property name of the enabledfinal voidinitialize(org.springframework.context.ConfigurableApplicationContext context) protected abstract voidinitialize(org.springframework.context.ConfigurableApplicationContext context, org.springframework.core.env.ConfigurableEnvironment environment) Initialize theConfigurableApplicationContext.protected booleanisEnabled(org.springframework.context.ConfigurableApplicationContext context, org.springframework.core.env.ConfigurableEnvironment environment) Is enabled or not
-
Field Details
-
logger
protected final io.microsphere.logging.Logger logger
-
-
Constructor Details
-
ConfigurableApplicationContextInitializer
public ConfigurableApplicationContextInitializer()
-
-
Method Details
-
initialize
public final void initialize(org.springframework.context.ConfigurableApplicationContext context) - Specified by:
initializein interfaceorg.springframework.context.ApplicationContextInitializer<org.springframework.context.ConfigurableApplicationContext>
-
initialize
protected abstract void initialize(org.springframework.context.ConfigurableApplicationContext context, org.springframework.core.env.ConfigurableEnvironment environment) Initialize theConfigurableApplicationContext.- Parameters:
context- theConfigurableApplicationContextenvironment- theConfigurableEnvironment
-
isEnabled
protected boolean isEnabled(org.springframework.context.ConfigurableApplicationContext context, org.springframework.core.env.ConfigurableEnvironment environment) Is enabled or not- Parameters:
context- theConfigurableApplicationContextenvironment- theConfigurableEnvironment- Returns:
- if enabled, return
true, orfalse
-
getEnabledPropertyName
Get the property name of the enabled- Returns:
- the property name of the enabled
-
getDefaultEnabled
protected boolean getDefaultEnabled()Get the default value of enabled- Returns:
- the default value of enabled
- See Also:
-