diff --git a/li.strolch.agent/src/main/java/li/strolch/agent/impl/InternalStrolchRealm.java b/li.strolch.agent/src/main/java/li/strolch/agent/impl/InternalStrolchRealm.java index 62801dfe7..7c2f7a326 100644 --- a/li.strolch.agent/src/main/java/li/strolch/agent/impl/InternalStrolchRealm.java +++ b/li.strolch.agent/src/main/java/li/strolch/agent/impl/InternalStrolchRealm.java @@ -104,7 +104,7 @@ public abstract class InternalStrolchRealm implements StrolchRealm { String propTryLockTimeUnit = StrolchConstants.makeRealmKey(this.realm, PROP_TRY_LOCK_TIME_UNIT); String propTryLockTime = StrolchConstants.makeRealmKey(this.realm, PROP_TRY_LOCK_TIME); TimeUnit timeUnit = TimeUnit.valueOf(configuration.getString(propTryLockTimeUnit, TimeUnit.SECONDS.name())); - long time = configuration.getLong(propTryLockTime, 10); + long time = configuration.getLong(propTryLockTime, 10L); this.lockHandler = new DefaultLockHandler(this.realm, timeUnit, time); // versioning diff --git a/li.strolch.agent/src/main/java/li/strolch/runtime/configuration/AbstractionConfiguration.java b/li.strolch.agent/src/main/java/li/strolch/runtime/configuration/AbstractionConfiguration.java index d618600fd..a915e9418 100644 --- a/li.strolch.agent/src/main/java/li/strolch/runtime/configuration/AbstractionConfiguration.java +++ b/li.strolch.agent/src/main/java/li/strolch/runtime/configuration/AbstractionConfiguration.java @@ -17,8 +17,10 @@ package li.strolch.runtime.configuration; import java.io.File; import java.text.MessageFormat; +import java.util.HashMap; import java.util.HashSet; import java.util.Map; +import java.util.Properties; import java.util.Set; import org.slf4j.Logger; @@ -42,6 +44,18 @@ public abstract class AbstractionConfiguration { return this.name; } + public Properties getAsProperties() { + Properties props = new Properties(); + for (String key : configurationValues.keySet()) { + props.setProperty(key, configurationValues.get(key)); + } + return props; + } + + public Map getAsMap() { + return new HashMap<>(this.configurationValues); + } + public boolean hasProperty(String key) { return this.configurationValues.containsKey(key); } @@ -82,7 +96,7 @@ public abstract class AbstractionConfiguration { return defValue; } - public int getInt(String key, int defValue) { + public int getInt(String key, Integer defValue) { String value = this.configurationValues.get(key); if (StringHelper.isNotEmpty(value)) { @@ -100,7 +114,7 @@ public abstract class AbstractionConfiguration { return defValue; } - public long getLong(String key, long defValue) { + public long getLong(String key, Long defValue) { String value = this.configurationValues.get(key); if (StringHelper.isNotEmpty(value)) {