Class StatefulPostProcessor
java.lang.Object
io.fluxzero.sdk.configuration.spring.StatefulPostProcessor
- All Implemented Interfaces:
org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
public class StatefulPostProcessor
extends Object
implements org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidpostProcessBeanDefinitionRegistry(@NonNull org.springframework.beans.factory.support.BeanDefinitionRegistry registry) No-op.voidpostProcessBeanFactory(@NonNull org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) Scans for beans annotated withStateful, wraps each of them in aFluxzeroPrototype, and registers them programmatically as Spring bean definitions.
-
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 withStateful, wraps each of them in aFluxzeroPrototype, 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.- Specified by:
postProcessBeanFactoryin interfaceorg.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor- Specified by:
postProcessBeanFactoryin interfaceorg.springframework.beans.factory.config.BeanFactoryPostProcessor- Parameters:
beanFactory- the currentConfigurableListableBeanFactory- 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.- Specified by:
postProcessBeanDefinitionRegistryin interfaceorg.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor- Parameters:
registry- theBeanDefinitionRegistry- Throws:
org.springframework.beans.BeansException
-