class JmxConfiguration {

    public static JmxConfiguration fromProperties(Configuration configuration) {
        boolean jmxEnabled = configuration.getBoolean("jmx.enabled", true);
        if (!jmxEnabled) {
            return DISABLED;
        }

        String address = configuration.getString("jmx.address", LOCALHOST);
        int port = configuration.getInt("jmx.port", DEFAULT_PORT);
        return new JmxConfiguration(ENABLED, Optional.of(Host.from(address, port)));
    }

    @VisibleForTesting  JmxConfiguration(boolean enabled, Optional<Host> host);

}