All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.charlemaznable.vertx.common.ConfigableHazelcastClusterManager Maven / Gradle / Ivy

package com.github.charlemaznable.vertx.common;

import com.hazelcast.config.ConfigBuilder;
import com.hazelcast.config.XmlConfigBuilder;
import com.hazelcast.config.YamlConfigBuilder;
import io.vertx.spi.cluster.hazelcast.HazelcastClusterManager;
import lombok.extern.slf4j.Slf4j;
import lombok.val;

import java.io.ByteArrayInputStream;

import static java.nio.charset.StandardCharsets.UTF_8;
import static org.apache.commons.lang3.StringUtils.startsWithIgnoreCase;

@Slf4j
public abstract class ConfigableHazelcastClusterManager
        extends HazelcastClusterManager implements ParamsConfigable {

    @Override
    public void applyConfigValue(String configValue) {
        // read config value as XML or YAML format
        val inputStream = new ByteArrayInputStream(configValue.getBytes(UTF_8));
        ConfigBuilder configBuilder = startsWithIgnoreCase(configValue, "




© 2015 - 2025 Weber Informatics LLC | Privacy Policy