Package io.hekate.spring.boot.network
Class HekateNetworkServiceConfigurer
- java.lang.Object
-
- io.hekate.spring.boot.network.HekateNetworkServiceConfigurer
-
@Configuration @ConditionalOnHekateEnabled @AutoConfigureBefore(HekateConfigurer.class) @ConditionalOnMissingBean(NetworkServiceFactory.class) public class HekateNetworkServiceConfigurer extends Object
« start hereAuto-configuration forNetworkService
.Overview
This auto-configuration constructs a
Bean
ofNetworkServiceFactory
type and automaticallyregisters
allBean
s ofNetworkConnectorConfig
type.Note: this auto-configuration is available only if application doesn't provide its own
Bean
ofNetworkServiceFactory
type.Configuration Properties
It is possible to configure
NetworkServiceFactory
via application properties prefixed with'hekate.network'
:'hekate.network.host'
'hekate.network.port'
'hekate.network.port-range'
'hekate.network.connect-timeout'
'hekate.network.server-failover-interval'
'hekate.network.heartbeat-interval'
'hekate.network.heartbeat-loss-threshold'
'hekate.network.nio-thread-pool-size'
'hekate.network.tcp-no-delay'
'hekate.network.tcp-receive-buffer-size'
'hekate.network.tcp-send-buffer-size'
'hekate.network.tcp-reuse-address'
'hekate.network.tcp-backlog'
SSL/TLS Configuration
SSL/TLS encryption can be enabled by setting the
'hekate.network.ssl.enable'
configuration property totrue
and using the following properties:'hekate.network.ssl.provider'
'hekate.network.ssl.key-store-path'
'hekate.network.ssl.key-store-password'
'hekate.network.ssl.key-store-type'
'hekate.network.ssl.key-store-algorithm'
'hekate.network.ssl.trust-store-path'
'hekate.network.ssl.trust-store-password'
'hekate.network.ssl.trust-store-type'
'hekate.network.ssl.trust-store-algorithm'
Connectors Injection
This auto-configuration provides support for injecting beans of
NetworkConnector
type into other beans with the help ofInjectConnector
annotation. Please see its documentation for more details.- See Also:
NetworkService
,HekateConfigurer
-
-
Constructor Summary
Constructors Constructor Description HekateNetworkServiceConfigurer(Optional<List<NetworkConnectorConfig<?>>> connectors)
Constructs new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NetworkServiceBean
networkService()
Returns a factory bean that makes it possible to injectNetworkService
directly into other beans instead of accessing it viaHekate.network()
method.NetworkServiceFactory
networkServiceFactory(Optional<NetworkSslConfig> ssl)
Constructs theNetworkServiceFactory
.NetworkSslConfig
networkSslConfig()
Constructs aNetworkSslConfig
.
-
-
-
Constructor Detail
-
HekateNetworkServiceConfigurer
public HekateNetworkServiceConfigurer(Optional<List<NetworkConnectorConfig<?>>> connectors)
Constructs new instance.- Parameters:
connectors
-NetworkConnectorConfig
s that were found in the application context.
-
-
Method Detail
-
networkSslConfig
@Bean @ConditionalOnMissingBean(NetworkSslConfig.class) @ConfigurationProperties(prefix="hekate.network.ssl") @ConditionalOnProperty(value="hekate.network.ssl.enable", havingValue="true") public NetworkSslConfig networkSslConfig()
Constructs aNetworkSslConfig
.- Returns:
- SSL configuration.
- See Also:
NetworkServiceFactory.setSsl(NetworkSslConfig)
-
networkServiceFactory
@Bean @ConfigurationProperties(prefix="hekate.network") public NetworkServiceFactory networkServiceFactory(Optional<NetworkSslConfig> ssl)
Constructs theNetworkServiceFactory
.- Parameters:
ssl
- Optional SSL configuration.- Returns:
- Service factory.
-
networkService
@Bean public NetworkServiceBean networkService()
Returns a factory bean that makes it possible to injectNetworkService
directly into other beans instead of accessing it viaHekate.network()
method.- Returns:
- Service bean.
-
-