Class ApplicationContextBuilder
FilesystemGenericApplicationContext equipped with various standard features,
behavior, converters, etc. that are applicable to the Shibboleth software components.- Since:
- 5.4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Collection<String>Bean profiles to enable.Configuration resources for this service.Unresolved configuration sources for this service.private List<ApplicationContextInitializer<? super FilesystemGenericApplicationContext>>List of context initializers.private StringContext name.private ConversionServiceConversion service to use.private List<BeanFactoryPostProcessor>List of bean factory post processors for this service's content.private booleanWhether to install a JVM shutdown hook.private final org.slf4j.LoggerClass logger.private ApplicationContextApplication context owning this engine.private List<BeanPostProcessor>List of bean post processors for this service's content.private List<PropertySource<?>>List of property sources to add. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build aGenericApplicationContextcontext.installShutdownHook(boolean flag) Set whether to install a JVM shutdown hook.Set a single bean factory post processor for this context.setBeanFactoryPostProcessors(List<BeanFactoryPostProcessor> processors) Set the list of bean factory post processors for this context.setBeanPostProcessor(BeanPostProcessor processor) Set a single bean post processor for this context.setBeanPostProcessors(List<BeanPostProcessor> processors) Set the list of bean post processors for this context.setBeanProfiles(Collection<String> profiles) Set the bean profiles for this context.setContextInitializer(ApplicationContextInitializer<? super FilesystemGenericApplicationContext> initializer) Set a single context initializer for this context.setContextInitializers(List<ApplicationContextInitializer<? super FilesystemGenericApplicationContext>> initializers) Set the list of context initializers for this context.setConversionService(ConversionService service) Set a conversion service to use.Set the name of the context.setParentContext(ApplicationContext context) Set the parent context.setPropertySources(List<PropertySource<?>> sources) Set additional property sources for this context.setServiceConfiguration(Resource config) Set a single configuration resource for this context.setServiceConfigurations(Collection<Resource> configs) Set the configurations for this context.Set the unresolved configurations for this context.
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
contextName
Context name. -
configurationSources
Unresolved configuration sources for this service. -
configurationResources
Configuration resources for this service. -
conversionService
Conversion service to use. -
contextInitializers
@Nullable private List<ApplicationContextInitializer<? super FilesystemGenericApplicationContext>> contextInitializersList of context initializers. -
factoryPostProcessors
List of bean factory post processors for this service's content. -
postProcessors
List of bean post processors for this service's content. -
propertySources
List of property sources to add. -
beanProfiles
Bean profiles to enable. -
parentContext
Application context owning this engine. -
installShutdownHook
private boolean installShutdownHookWhether to install a JVM shutdown hook.
-
-
Constructor Details
-
ApplicationContextBuilder
public ApplicationContextBuilder()
-
-
Method Details
-
setName
Set the name of the context.- Parameters:
name- name- Returns:
- this builder
-
setConversionService
Set a conversion service to use.- Parameters:
service- conversion service- Returns:
- this builder
-
setServiceConfiguration
Set a single configuration resource for this context.- Parameters:
config- configuration for this context- Returns:
- this builder
-
setUnresolvedServiceConfigurations
@Nonnull public ApplicationContextBuilder setUnresolvedServiceConfigurations(@Nonnull Collection<String> configs) Set the unresolved configurations for this context.This method is used to allow the context to resolve the resources.
- Parameters:
configs- unresolved configurations for this context- Returns:
- this builder
- Since:
- 7.0.0
-
setServiceConfigurations
@Nonnull public ApplicationContextBuilder setServiceConfigurations(@Nonnull Collection<Resource> configs) Set the configurations for this context.- Parameters:
configs- configurations for this context- Returns:
- this builder
-
setPropertySources
@Nonnull public ApplicationContextBuilder setPropertySources(@Nonnull List<PropertySource<?>> sources) Set additional property sources for this context.- Parameters:
sources- property sources to add- Returns:
- this builder
-
setContextInitializer
@Nonnull public ApplicationContextBuilder setContextInitializer(@Nonnull ApplicationContextInitializer<? super FilesystemGenericApplicationContext> initializer) Set a single context initializer for this context.- Parameters:
initializer- initializer to apply- Returns:
- this builder
-
setContextInitializers
@Nonnull public ApplicationContextBuilder setContextInitializers(@Nonnull List<ApplicationContextInitializer<? super FilesystemGenericApplicationContext>> initializers) Set the list of context initializers for this context.- Parameters:
initializers- initializers to apply- Returns:
- this builder
-
setBeanFactoryPostProcessor
@Nonnull public ApplicationContextBuilder setBeanFactoryPostProcessor(@Nonnull BeanFactoryPostProcessor processor) Set a single bean factory post processor for this context.Note that if this object is
ApplicationContextAwareorEnvironmentAware, that is injected by the builder. Do NOT pass in processors that already contain references to a parent context.- Parameters:
processor- bean factory post processor to apply- Returns:
- this builder
-
setBeanFactoryPostProcessors
@Nonnull public ApplicationContextBuilder setBeanFactoryPostProcessors(@Nonnull List<BeanFactoryPostProcessor> processors) Set the list of bean factory post processors for this context.Note that if these objects are
ApplicationContextAwareorEnvironmentAware, that is injected by the builder. Do NOT pass in processors that already contain references to a parent context.- Parameters:
processors- bean factory post processors to apply- Returns:
- this builder
-
setBeanPostProcessor
@Nonnull public ApplicationContextBuilder setBeanPostProcessor(@Nonnull BeanPostProcessor processor) Set a single bean post processor for this context.Note that if this object is
ApplicationContextAwareorEnvironmentAware, that is injected by the builder. Do NOT pass in processors that already contain references to a parent context.- Parameters:
processor- bean post processor to apply- Returns:
- this builder
-
setBeanPostProcessors
@Nonnull public ApplicationContextBuilder setBeanPostProcessors(@Nonnull List<BeanPostProcessor> processors) Set the list of bean post processors for this context.Note that if these objects are
ApplicationContextAwareorEnvironmentAware, that is injected by the builder. Do NOT pass in processors that already contain references to a parent context.- Parameters:
processors- bean post processors to apply- Returns:
- this builder
-
setBeanProfiles
Set the bean profiles for this context.- Parameters:
profiles- bean profiles to apply- Returns:
- this builder
-
setParentContext
Set the parent context.- Parameters:
context- parent context- Returns:
- this builder
-
installShutdownHook
Set whether to install a JVM shutdown hook.Defaults to false.
- Parameters:
flag- flag to set- Returns:
- this builder
- Since:
- 7.0.0
-
build
Build aGenericApplicationContextcontext.- Returns:
- the built context, initialized and loaded
-