mreutegg commented on code in PR #6:
URL:
https://github.com/apache/sling-org-apache-sling-discovery-impl/pull/6#discussion_r1753235944
##########
src/main/java/org/apache/sling/discovery/impl/Config.java:
##########
@@ -227,50 +124,40 @@ public class Config implements BaseConfig,
DiscoveryLiteConfig {
private boolean useSyncTokenService = true;
@Activate
- protected void activate(final Map<String, Object> properties) {
+ protected void activate(final DiscoveryServiceConfig config) {
logger.debug("activate: config activated.");
- configure(properties);
+ configure(config);
}
- protected void configure(final Map<String, Object> properties) {
- this.heartbeatTimeout = PropertiesUtil.toLong(
- properties.get(HEARTBEAT_TIMEOUT_KEY),
- DEFAULT_HEARTBEAT_TIMEOUT);
+ protected void configure(final DiscoveryServiceConfig config) {
+ this.heartbeatTimeout = config.heartbeatTimeout();
logger.debug("configure: heartbeatTimeout='{}'",
this.heartbeatTimeout);
- this.heartbeatInterval = PropertiesUtil.toLong(
- properties.get(HEARTBEAT_INTERVAL_KEY),
- DEFAULT_HEARTBEAT_INTERVAL);
+ this.heartbeatInterval = config.heartbeatInterval();
logger.debug("configure: heartbeatInterval='{}'",
this.heartbeatInterval);
- this.minEventDelay = PropertiesUtil.toInteger(
- properties.get(MIN_EVENT_DELAY_KEY),
- DEFAULT_MIN_EVENT_DELAY);
+ this.minEventDelay = config.minEventDelay();
logger.debug("configure: minEventDelay='{}'",
this.minEventDelay);
- this.connectionTimeout = PropertiesUtil.toInteger(
- properties.get(CONNECTION_TIMEOUT_KEY),
- DEFAULT_CONNECTION_TIMEOUT);
+ this.connectionTimeout = config.connectionTimeout();
logger.debug("configure: connectionTimeout='{}'",
this.connectionTimeout);
- this.soTimeout = PropertiesUtil.toInteger(
- properties.get(SO_TIMEOUT_KEY),
- DEFAULT_SO_TIMEOUT);
+ this.soTimeout = config.soTimeout();
logger.debug("configure: soTimeout='{}'",
this.soTimeout);
Review Comment:
You mean the field declarations?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]