Class SegmentIdBeanRegistrar
java.lang.Object
me.ahoo.cosid.spring.boot.starter.segment.SegmentIdBeanRegistrar
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean
public class SegmentIdBeanRegistrar
extends Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSegmentIdBeanRegistrar(CosIdProperties cosIdProperties, SegmentIdProperties segmentIdProperties, IdSegmentDistributorFactory distributorFactory, IdGeneratorProvider idGeneratorProvider, PrefetchWorkerExecutorService prefetchWorkerExecutorService, org.springframework.beans.factory.ObjectProvider<CustomizeSegmentIdProperties> customizers, @Nullable org.springframework.beans.factory.support.BeanDefinitionRegistry beanDefinitions) Create the factory of the segment ids: runs everyCustomizeSegmentIdPropertieson the properties first. -
Method Summary
Modifier and TypeMethodDescriptionvoidSegment ids a customizer added have no bean definition: they are only registered in the provider, here.static StringThe bean name of the segment idname.create(String name, SegmentIdProperties.IdDefinition idDefinition) Create the segment idnameand register it in theIdGeneratorProviderunless one is there.createBean(String name) The factory method of the{name}SegmentIdbeans.The segment ids of the properties: the share, when enabled, and the named ones.voiddestroy()Remove the ids from the provider, where it still holds them, so a later context does not get closed ones; close the ids that are not beans.
-
Field Details
-
BEAN_NAME
The bean name, the factory bean of the{name}SegmentIdbean definitions.- See Also:
-
-
Constructor Details
-
SegmentIdBeanRegistrar
public SegmentIdBeanRegistrar(CosIdProperties cosIdProperties, SegmentIdProperties segmentIdProperties, IdSegmentDistributorFactory distributorFactory, IdGeneratorProvider idGeneratorProvider, PrefetchWorkerExecutorService prefetchWorkerExecutorService, org.springframework.beans.factory.ObjectProvider<CustomizeSegmentIdProperties> customizers, @Nullable org.springframework.beans.factory.support.BeanDefinitionRegistry beanDefinitions) Create the factory of the segment ids: runs everyCustomizeSegmentIdPropertieson the properties first.- Parameters:
beanDefinitions- the registry of the{name}SegmentIdbean definitions,nullfor none
-
-
Method Details
-
beanName
The bean name of the segment idname. -
definitions
The segment ids of the properties: the share, when enabled, and the named ones. -
createBean
The factory method of the{name}SegmentIdbeans. -
afterPropertiesSet
public void afterPropertiesSet()Segment ids a customizer added have no bean definition: they are only registered in the provider, here.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
destroy
Remove the ids from the provider, where it still holds them, so a later context does not get closed ones; close the ids that are not beans.- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
Exception
-
create
Create the segment idnameand register it in theIdGeneratorProviderunless one is there.
-