Skip to content

Commit

Permalink
further alignment on jmx connection handling (using jxmremote.rmi.por…
Browse files Browse the repository at this point in the history
…t as

config value)
  • Loading branch information
tkohegyi committed Aug 18, 2016
1 parent 34a7d3b commit ae2e559
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
along with Wilma. If not, see <http://www.gnu.org/licenses/>.
===========================================================================*/

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

Expand All @@ -36,6 +38,8 @@
public class SafeguardConfigurationAccess implements ConfigurationAccessBase {

private static final String DEFAULT_JMX_PORT = "1099";
private final Logger logger = LoggerFactory.getLogger(SafeguardConfigurationAccess.class);

private PropertyDTO propertyDTO;

@Autowired
Expand All @@ -47,11 +51,12 @@ public void loadProperties() {
Long fiOnLimit = propertyHolder.getLong("safeguard.responseFIdecoder.ONlimit");
Long mwOffLimit = propertyHolder.getLong("safeguard.responseMessageWriter.OFFlimit");
Long mwOnLimit = propertyHolder.getLong("safeguard.responseMessageWriter.ONlimit");
String jmxPort = propertyHolder.get("com.sun.management.jmxremote.port");
if ((jmxPort == null) || (tryParseInt(jmxPort) == 0)) {
jmxPort = DEFAULT_JMX_PORT;
String rmiPort = System.getProperty("com.sun.management.jmxremote.rmi.port");
if ((rmiPort == null) || (tryParseInt(rmiPort) == 0)) {
rmiPort = DEFAULT_JMX_PORT;
}
SafeguardLimits safeguardLimits = new SafeguardLimits(fiOffLimit, fiOnLimit, mwOffLimit, mwOnLimit, jmxPort);
logger.info("RMI: using port:" + rmiPort);
SafeguardLimits safeguardLimits = new SafeguardLimits(fiOffLimit, fiOnLimit, mwOffLimit, mwOnLimit, rmiPort);
String cronExpression = propertyHolder.get("safeguard.guardperiod");
propertyDTO = new PropertyDTO(safeguardLimits, cronExpression);
}
Expand Down

0 comments on commit ae2e559

Please sign in to comment.