Class CBORConverterAutoConfiguration
java.lang.Object
org.axonframework.extension.springboot.autoconfig.CBORConverterAutoConfiguration
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware
@AutoConfiguration
@AutoConfigureBefore(ConverterAutoConfiguration.class)
@ConditionalOnClass(name="tools.jackson.dataformat.cbor.CBORMapper")
@EnableConfigurationProperties(ConverterProperties.class)
public class CBORConverterAutoConfiguration
extends Object
implements org.springframework.beans.factory.BeanClassLoaderAware
Autoconfigures the CBOR based
JacksonConverter if configured via the ConverterProperties.- Since:
- 5.1.0
- Author:
- Jakob Hatzl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconverter(tools.jackson.dataformat.cbor.CBORMapper cborMapper) Bean creation method constructing a CBOR basedJacksonConverteras theGeneralConverterto be used by Axon Framework.delegatingEventConverter(MessageConverter messageConverter) Bean creation method constructing anEventConverterdelegating to theMessageConverterin case both usecbor.delegatingMessageConverter(GeneralConverter generalConverter) Bean creation method constructing aMessageConverterdelegating to theGeneralConverterin case both usecbor.eventConverter(tools.jackson.dataformat.cbor.CBORMapper cborMapper) Bean creation method constructing a CBOR basedJacksonConverteras theEventConverterto be used by Axon Framework.messageConverter(tools.jackson.dataformat.cbor.CBORMapper cborMapper) Bean creation method constructing a CBOR basedJacksonConverteras theMessageConverterto be used by Axon Framework.voidsetBeanClassLoader(ClassLoader classLoader) Sets the class loader used by theChainingContentTypeConverterto loadContentTypeConverters.
-
Constructor Details
-
CBORConverterAutoConfiguration
public CBORConverterAutoConfiguration()
-
-
Method Details
-
converter
@Bean @Primary @ConditionalOnMissingBean(ignored={MessageConverter.class,EventConverter.class}) @ConditionalOnProperty(name="axon.converter.general", havingValue="cbor") public GeneralConverter converter(tools.jackson.dataformat.cbor.CBORMapper cborMapper) Bean creation method constructing a CBOR basedJacksonConverteras theGeneralConverterto be used by Axon Framework.- Parameters:
cborMapper- theCBORMapperto be used- Returns:
- the
GeneralConverterto be used by Axon Framework
-
delegatingMessageConverter
@Bean(name="messageConverter") @ConditionalOnMissingBean @ConditionalOnExpression("\'${axon.converter.messages}\' == \'cbor\' && \'${axon.converter.general}\' == \'cbor\'") public MessageConverter delegatingMessageConverter(GeneralConverter generalConverter) Bean creation method constructing aMessageConverterdelegating to theGeneralConverterin case both usecbor.- Parameters:
generalConverter- theGeneralConverter, used to construct theMessageConverterin case both usecbor- Returns:
- the
MessageConverterto be used by Axon Framework
-
messageConverter
@Bean @ConditionalOnMissingBean @ConditionalOnExpression("\'${axon.converter.messages}\' == \'cbor\' && \'${axon.converter.general}\' != \'cbor\'") public MessageConverter messageConverter(tools.jackson.dataformat.cbor.CBORMapper cborMapper) Bean creation method constructing a CBOR basedJacksonConverteras theMessageConverterto be used by Axon Framework.- Parameters:
cborMapper- theCBORMapperto be used- Returns:
- the
MessageConverterto be used by Axon Framework
-
delegatingEventConverter
@Bean(name="eventConverter") @ConditionalOnMissingBean @ConditionalOnExpression("\'${axon.converter.events}\' == \'cbor\' && \'${axon.converter.messages}\' == \'cbor\'") public EventConverter delegatingEventConverter(MessageConverter messageConverter) Bean creation method constructing anEventConverterdelegating to theMessageConverterin case both usecbor.- Parameters:
messageConverter- theMessageConverter, used to construct theEventConverterin case both usecbor- Returns:
- the
EventConverterto be used by Axon Framework
-
eventConverter
@Bean @ConditionalOnMissingBean @ConditionalOnExpression("\'${axon.converter.events}\' == \'cbor\' && \'${axon.converter.messages}\' != \'cbor\'") public EventConverter eventConverter(tools.jackson.dataformat.cbor.CBORMapper cborMapper) Bean creation method constructing a CBOR basedJacksonConverteras theEventConverterto be used by Axon Framework.- Parameters:
cborMapper- theCBORMapperto be used- Returns:
- the
EventConverterto be used by Axon Framework
-
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
-