Class ConverterAutoConfiguration
java.lang.Object
org.axonframework.extension.springboot.autoconfig.ConverterAutoConfiguration
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.context.ApplicationContextAware
@AutoConfiguration
@AutoConfigureBefore(AxonAutoConfiguration.class)
@EnableConfigurationProperties(ConverterProperties.class)
public class ConverterAutoConfiguration
extends Object
implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanClassLoaderAware
Autoconfiguration class dedicated to configuring the
Converter.
Users can influence the configuration through the ConverterProperties.
- Since:
- 5.0.0
- Author:
- Steven van Beelen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconverter(ConverterProperties converterProperties) Bean creation method constructing the "general"Converterto be used by Axon Framework.eventConverter(Converter generalConverter, MessageConverter messageConverter, ConverterProperties converterProperties) Bean creation method constructing theEventConverterto be used by Axon Framework.messageConverter(Converter generalConverter, ConverterProperties converterProperties) Bean creation method constructing theMessageConverterto be used by Axon Framework.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) Sets the application context used to validate for the existence of other required properties to construct the specifiedConverters.voidsetBeanClassLoader(ClassLoader classLoader) Sets the class loader used by theChainingContentTypeConverterto loadContentTypeConverters.
-
Constructor Details
-
ConverterAutoConfiguration
public ConverterAutoConfiguration()
-
-
Method Details
-
converter
@Bean @Primary @ConditionalOnMissingBean public Converter converter(ConverterProperties converterProperties) Bean creation method constructing the "general"Converterto be used by Axon Framework.The type of
Converterconstructed depends on the givenconverterProperties. -
messageConverter
@Bean @ConditionalOnMissingBean public MessageConverter messageConverter(Converter generalConverter, ConverterProperties converterProperties) Bean creation method constructing theMessageConverterto be used by Axon Framework.- Parameters:
generalConverter- The "general"Converter, used to construct theMessageConverterwhenever theConverterProperties.getMessages()type equals theConverterProperties.getGeneral()type.converterProperties- The properties dictating the type ofMessageConverterthis bean creation method will construct.- Returns:
- The
MessageConverterto be used by Axon Framework.
-
eventConverter
@Bean @ConditionalOnMissingBean public EventConverter eventConverter(Converter generalConverter, MessageConverter messageConverter, ConverterProperties converterProperties) Bean creation method constructing theEventConverterto be used by Axon Framework.- Parameters:
generalConverter- The "general"Converter, used to construct theEventConverterwhenever theConverterProperties.getEvents()type equals theConverterProperties.getGeneral()type.messageConverter- TheMessageConverter, used to construct theEventConverterwhenever theConverterProperties.getEvents()type equals theConverterProperties.getMessages()type.converterProperties- The properties dictating the type ofConverterthis bean creation method will construct.- Returns:
- The
EventConverterto be used by Axon Framework.
-
setApplicationContext
public void setApplicationContext(@Nonnull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException Sets the application context used to validate for the existence of other required properties to construct the specifiedConverters.- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Parameters:
applicationContext- The application context used to validate for the existence of other required properties to construct the specifiedConverters.- Throws:
org.springframework.beans.BeansException
-
setBeanClassLoader
Sets the class loader used by theChainingContentTypeConverterto loadContentTypeConverters.- Specified by:
setBeanClassLoaderin interfaceorg.springframework.beans.factory.BeanClassLoaderAware- Parameters:
classLoader- The class loader used by theChainingContentTypeConverterto loadContentTypeConverters.
-