Module net.shibboleth.ext.spring
Package net.shibboleth.ext.spring.util
Class ApplicationContextBuilder
- java.lang.Object
-
- net.shibboleth.ext.spring.util.ApplicationContextBuilder
-
public class ApplicationContextBuilder extends Object
Fluent builder for aFilesystemGenericApplicationContextequipped with various standard features, behavior, converters, etc. that are applicable to the Shibboleth software components.- Since:
- 5.4.0
-
-
Field Summary
Fields Modifier and Type Field Description private Collection<String>beanProfilesBean profiles to enable.private Collection<Resource>configurationResourcesConfiguration resources for this service.private List<ApplicationContextInitializer<? super FilesystemGenericApplicationContext>>contextInitializersList of context initializers.private StringcontextNameContext name.private ConversionServiceconversionServiceConversion service to use.private List<BeanFactoryPostProcessor>factoryPostProcessorsList of bean factory post processors for this service's content.private org.slf4j.LoggerlogClass logger.private ApplicationContextparentContextApplication context owning this engine.private List<BeanPostProcessor>postProcessorsList of bean post processors for this service's content.private List<PropertySource<?>>propertySourcesList of property sources to add.
-
Constructor Summary
Constructors Constructor Description ApplicationContextBuilder()
-
Method Summary
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
configurationResources
@Nullable @NonnullElements private Collection<Resource> configurationResources
Configuration resources for this service.
-
conversionService
@Nullable private ConversionService conversionService
Conversion service to use.
-
contextInitializers
@Nullable @NonnullElements private List<ApplicationContextInitializer<? super FilesystemGenericApplicationContext>> contextInitializers
List of context initializers.
-
factoryPostProcessors
@Nullable @NonnullElements private List<BeanFactoryPostProcessor> factoryPostProcessors
List of bean factory post processors for this service's content.
-
postProcessors
@Nullable @NonnullElements private List<BeanPostProcessor> postProcessors
List of bean post processors for this service's content.
-
propertySources
@Nullable @NonnullElements private List<PropertySource<?>> propertySources
List of property sources to add.
-
beanProfiles
@Nullable @NonnullElements private Collection<String> beanProfiles
Bean profiles to enable.
-
parentContext
@Nullable private ApplicationContext parentContext
Application context owning this engine.
-
-
Method Detail
-
setName
@Nonnull public ApplicationContextBuilder setName(@Nullable @NotEmpty String name)
Set the name of the context.- Parameters:
name- name- Returns:
- this builder
-
setConversionService
@Nonnull public ApplicationContextBuilder setConversionService(@Nullable ConversionService service)
Set a conversion service to use.- Parameters:
service- conversion service- Returns:
- this builder
-
setServiceConfiguration
@Nonnull public ApplicationContextBuilder setServiceConfiguration(@Nonnull Resource config)
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
@Nonnull public ApplicationContextBuilder setParentContext(@Nullable ApplicationContext context)
Set a customConversionServiceto use.- Parameters:
context- parent context- Returns:
- this builder
-
build
@Nonnull public GenericApplicationContext build()
Build the context.- Returns:
- the built context, initialized and loaded
-
-