Class MappingPdxSerializerIncludedTypesRegistrar

java.lang.Object
org.springframework.geode.pdx.MappingPdxSerializerIncludedTypesRegistrar
All Implemented Interfaces:
org.springframework.beans.factory.config.BeanPostProcessor

public class MappingPdxSerializerIncludedTypesRegistrar extends Object implements org.springframework.beans.factory.config.BeanPostProcessor
Spring BeanPostProcessor used to register additional types handled by the SDG MappingPdxSerializer.
Since:
1.5.0
See Also:
  • Class
  • Predicate
  • GemFireCache
  • PdxSerializer
  • BeanPostProcessor
  • MappingPdxSerializer
  • Constructor Details

    • MappingPdxSerializerIncludedTypesRegistrar

      public MappingPdxSerializerIncludedTypesRegistrar(@NonNull Class<?>[] types)
      Constructs a new instance of MappingPdxSerializerIncludedTypesRegistrar initialized with given, required array of Class types that will be registered with SDG's MappingPdxSerializer in order to de/serialize the specified Class types as PDX.
      Parameters:
      types - array of Class types to be de/serialized as PDX using SDG's MappingPdxSerializer; must not be null.
      See Also:
  • Method Details

    • with

      @NonNull public static MappingPdxSerializerIncludedTypesRegistrar with(Class<?>... types)
      Factory methods used to construct a new instance of MappingPdxSerializerIncludedTypesRegistrar initialized with given, required array of Class types that will be registered with SDG's MappingPdxSerializer in order to de/serialize the specified Class types as PDX.
      Parameters:
      types - array of Class types to be de/serialized as PDX using SDG's MappingPdxSerializer; must not be null.
      Returns:
      a new instance of MappingPdxSerializerIncludedTypesRegistrar
      See Also:
    • getTypes

      @NonNull protected Class<?>[] getTypes()
      Gets the array of Class types to register with SDG's MappingPdxSerializer in order to de/serialize the Class types as PDX.
      Returns:
      the configured array of Class types to be registered with SDG's MappingPdxSerializer in order to de/serialize the Class types as PDX; never null.
      See Also:
    • getCompositeIncludeTypeFilter

      protected Optional<Predicate<Class<?>>> getCompositeIncludeTypeFilter()
      Composes an Optional Predicate consisting of the configured array Class types used to match possible types de/serialized as PDX using SDG's MappingPdxSerializer.
      Returns:
      an Optional composite Predicate consisting of the configured array of Class types.
      See Also:
    • newIncludeTypeFilter

      @Nullable protected Predicate<Class<?>> newIncludeTypeFilter(@Nullable Class<?> type)
      Null-safe method used to construct a new type include filter that can be registered with SDG's MappingPdxSerializer. The Predicate matches tested types that are assignable from the given type.
      Parameters:
      type - Class used as the basis for matching in the Predicate.
      Returns:
      an (optional} Predicate from the given type; returns null if the given type is null.
      See Also:
    • postProcessAfterInitialization

      @Nullable public Object postProcessAfterInitialization(@Nullable Object bean, @Nullable String beanName) throws org.springframework.beans.BeansException
      Registers the configured Class types with SDG's MappingPdxSerializer providing the bean to post process after initialization is a GemFireCache instance and SDG's MappingPdxSerializer was configured as the cache's PdxSerializer used to de/serialize objects of the specified Class types.
      Specified by:
      postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
      Parameters:
      bean - bean to evaluate.
      beanName - String specifying the name of the bean in the Spring container.
      Returns:
      the given Object bean.
      Throws:
      org.springframework.beans.BeansException - if post processing of the bean fails.