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 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 based JacksonConverter as the GeneralConverter to be used by Axon Framework.
      Parameters:
      cborMapper - the CBORMapper to be used
      Returns:
      the GeneralConverter to 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 a MessageConverter delegating to the GeneralConverter in case both use cbor.
      Parameters:
      generalConverter - the GeneralConverter, used to construct the MessageConverter in case both use cbor
      Returns:
      the MessageConverter to 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 based JacksonConverter as the MessageConverter to be used by Axon Framework.
      Parameters:
      cborMapper - the CBORMapper to be used
      Returns:
      the MessageConverter to 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 an EventConverter delegating to the MessageConverter in case both use cbor.
      Parameters:
      messageConverter - the MessageConverter, used to construct the EventConverter in case both use cbor
      Returns:
      the EventConverter to 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 based JacksonConverter as the EventConverter to be used by Axon Framework.
      Parameters:
      cborMapper - the CBORMapper to be used
      Returns:
      the EventConverter to be used by Axon Framework
    • setBeanClassLoader

      public void setBeanClassLoader(ClassLoader classLoader)
      Sets the class loader used by the ChainingContentTypeConverter to load ContentTypeConverters.
      Specified by:
      setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAware
      Parameters:
      classLoader - the class loader used by the ChainingContentTypeConverter to load ContentTypeConverters