Class StatefulPostProcessor

java.lang.Object
io.fluxzero.sdk.configuration.spring.StatefulPostProcessor

public class StatefulPostProcessor extends Object
Spring BeanDefinitionRegistryPostProcessor that automatically detects beans annotated with Stateful and registers them as FluxzeroPrototype definitions for use in Fluxzero.

This enables Fluxzero to treat prototype-scoped, stateful beans as handler instances that are discovered and managed at runtime by the handler registry (via the HandlerFactory).

Usage

To use this mechanism, annotate a Spring bean with @Stateful and ensure that Spring picks up this processor, for example via FluxzeroSpringConfig.
See Also:
  • Constructor Details

    • StatefulPostProcessor

      public StatefulPostProcessor()
  • Method Details

    • postProcessBeanFactory

      public void postProcessBeanFactory(@NonNull @NonNull org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) throws org.springframework.beans.BeansException
      Scans for beans annotated with Stateful, wraps each of them in a FluxzeroPrototype, and registers them programmatically as Spring bean definitions.

      If the bean factory does not support dynamic registration (i.e., is not a BeanDefinitionRegistry), a warning is logged and the operation is skipped.

      Parameters:
      beanFactory - the current ConfigurableListableBeanFactory
      Throws:
      org.springframework.beans.BeansException
    • postProcessBeanDefinitionRegistry

      public void postProcessBeanDefinitionRegistry(@NonNull @NonNull org.springframework.beans.factory.support.BeanDefinitionRegistry registry) throws org.springframework.beans.BeansException
      No-op. This implementation does not modify the registry at this phase.
      Parameters:
      registry - the BeanDefinitionRegistry
      Throws:
      org.springframework.beans.BeansException