Package io.hekate.spring.boot.election
Class HekateElectionServiceConfigurer
- java.lang.Object
-
- io.hekate.spring.boot.election.HekateElectionServiceConfigurer
-
@Configuration @ConditionalOnHekateEnabled @AutoConfigureBefore(HekateConfigurer.class) @ConditionalOnBean(CandidateConfig.class) @ConditionalOnMissingBean(ElectionServiceFactory.class) public class HekateElectionServiceConfigurer extends Object
« start hereAuto-configuration forElectionService
.Overview
This auto-configuration constructs a
Bean
ofElectionServiceFactory
type and automaticallyregisters
allBean
s ofCandidateConfig
type.Note: this auto-configuration is available only if application doesn't provide its own
Bean
ofElectionServiceFactory
type and if there is at least oneBean
ofCandidateConfig
type within the application context.- See Also:
ElectionService
,HekateConfigurer
-
-
Constructor Summary
Constructors Constructor Description HekateElectionServiceConfigurer(Optional<List<CandidateConfig>> candidates)
Constructs new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ElectionServiceBean
electionService()
Returns the factory bean that makes it possible to injectElectionService
directly into other beans instead of accessing it viaHekate.election()
method.ElectionServiceFactory
electionServiceFactory()
Constructs theElectionServiceFactory
.
-
-
-
Constructor Detail
-
HekateElectionServiceConfigurer
public HekateElectionServiceConfigurer(Optional<List<CandidateConfig>> candidates)
Constructs new instance.- Parameters:
candidates
-CandidateConfig
s that were found in the application context.
-
-
Method Detail
-
electionServiceFactory
@Bean public ElectionServiceFactory electionServiceFactory()
Constructs theElectionServiceFactory
.- Returns:
- Service factory.
-
electionService
@Lazy @Bean public ElectionServiceBean electionService()
Returns the factory bean that makes it possible to injectElectionService
directly into other beans instead of accessing it viaHekate.election()
method.- Returns:
- Service bean.
-
-