Package net.shibboleth.ext.spring.util
Class ApplicationContextBuilder
java.lang.Object
net.shibboleth.ext.spring.util.ApplicationContextBuilder
Fluent builder for a
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.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 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.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.
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
contextName
Context name. -
configurationResources
Configuration resources for this service. -
conversionService
Conversion service to use. -
contextInitializers
@Nullable @NonnullElements 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.
-
-
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
-
setServiceConfigurations
@Nonnull public ApplicationContextBuilder setServiceConfigurations(@Nonnull @NonnullElements Collection<Resource> configs) Set the configurations for this context.- Parameters:
configs- configurations for this context- Returns:
- this builder
-
setPropertySources
@Nonnull public ApplicationContextBuilder setPropertySources(@Nonnull @NonnullElements 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 @NonnullElements 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.- Parameters:
processor- bean factory post processor to apply- Returns:
- this builder
-
setBeanFactoryPostProcessors
@Nonnull public ApplicationContextBuilder setBeanFactoryPostProcessors(@Nonnull @NonnullElements List<BeanFactoryPostProcessor> processors) Set the list of bean factory post processors for this 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.- Parameters:
processor- bean post processor to apply- Returns:
- this builder
-
setBeanPostProcessors
@Nonnull public ApplicationContextBuilder setBeanPostProcessors(@Nonnull @NonnullElements List<BeanPostProcessor> processors) Set the list of bean post processors for this context.- Parameters:
processors- bean post processors to apply- Returns:
- this builder
-
setBeanProfiles
@Nonnull public ApplicationContextBuilder setBeanProfiles(@Nonnull @NonnullElements Collection<String> profiles) 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
-
build
Build aGenericApplicationContextcontext.- Returns:
- the built context, initialized and loaded
-