Class SnowflakeIdBeanDefinitionRegistrar
java.lang.Object
me.ahoo.cosid.spring.boot.starter.snowflake.SnowflakeIdBeanDefinitionRegistrar
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.config.BeanFactoryPostProcessor,org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor,org.springframework.context.EnvironmentAware
public class SnowflakeIdBeanDefinitionRegistrar
extends Object
implements org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor, org.springframework.context.EnvironmentAware
Registers a bean definition per snowflake id of
cosid.snowflake.share and cosid.snowflake.provider,
named {name}SnowflakeId: other beans can depend on them (@DependsOn("orderSnowflakeId")).
It only reads the id names from the environment and instantiates nothing. Each bean definition is the factory
method SnowflakeIdBeanRegistrar.createBean(String) of the SnowflakeIdBeanRegistrar.BEAN_NAME bean, which
runs the CustomizeSnowflakeIdProperties in the normal bean lifecycle. Ids a customizer adds have no bean
definition: they are only registered in the IdGeneratorProvider.
- Since:
- 4.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidpostProcessBeanDefinitionRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry registry) voidpostProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) voidsetEnvironment(org.springframework.core.env.Environment environment)
-
Constructor Details
-
SnowflakeIdBeanDefinitionRegistrar
public SnowflakeIdBeanDefinitionRegistrar()
-
-
Method Details
-
setEnvironment
public void setEnvironment(org.springframework.core.env.Environment environment) - Specified by:
setEnvironmentin interfaceorg.springframework.context.EnvironmentAware
-
postProcessBeanDefinitionRegistry
public void postProcessBeanDefinitionRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry registry) - Specified by:
postProcessBeanDefinitionRegistryin interfaceorg.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
-
postProcessBeanFactory
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) - Specified by:
postProcessBeanFactoryin interfaceorg.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor- Specified by:
postProcessBeanFactoryin interfaceorg.springframework.beans.factory.config.BeanFactoryPostProcessor
-