Package io.hekate.spring.boot.lock
Class HekateLockServiceConfigurer
- java.lang.Object
-
- io.hekate.spring.boot.lock.HekateLockServiceConfigurer
-
@Configuration @ConditionalOnHekateEnabled @AutoConfigureBefore(HekateConfigurer.class) @ConditionalOnBean(LockRegionConfig.class) @ConditionalOnMissingBean(LockServiceFactory.class) public class HekateLockServiceConfigurer extends Object
« start hereAuto-configuration forLockService
.Overview
This auto-configuration constructs a
Bean
ofLockServiceFactory
type and automaticallyregisters
allBean
s ofLockRegionConfig
type.Note: this auto-configuration is available only if application doesn't provide its own
Bean
ofLockServiceFactory
type and if there is at least oneBean
ofLockRegionConfig
type within the application context.Configuration Properties
It is possible to configure
LockServiceFactory
via application properties prefixed with'hekate.locks'
. For example:Locks Injections
This auto-configuration provides support for injecting beans of
LockRegion
andDistributedLock
type into other beans with the help ofInjectLockRegion
andInjectLock
annotations.Please see the documentation of the following annotations for more details:
InjectLockRegion
- for injection ofLockRegion
sInjectLock
- for injection ofDistributedLock
s
- See Also:
LockService
,HekateConfigurer
-
-
Constructor Summary
Constructors Constructor Description HekateLockServiceConfigurer(Optional<List<LockRegionConfig>> regions)
Constructs new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LockServiceBean
lockService()
Returns the factory bean that makes it possible to injectLockService
directly into other beans instead of accessing it viaHekate.locks()
method.LockServiceFactory
lockServiceFactory()
Constructs theLockServiceFactory
.
-
-
-
Constructor Detail
-
HekateLockServiceConfigurer
public HekateLockServiceConfigurer(Optional<List<LockRegionConfig>> regions)
Constructs new instance.- Parameters:
regions
-LockRegionConfig
s that were found in the application context.
-
-
Method Detail
-
lockServiceFactory
@Bean @ConfigurationProperties(prefix="hekate.locks") public LockServiceFactory lockServiceFactory()
Constructs theLockServiceFactory
.- Returns:
- Service factory.
-
lockService
@Lazy @Bean public LockServiceBean lockService()
Returns the factory bean that makes it possible to injectLockService
directly into other beans instead of accessing it viaHekate.locks()
method.- Returns:
- Service bean.
-
-