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

io.jsync.spi.cluster.impl.ProgrammableClusterManagerFactory Maven / Gradle / Ivy

There is a newer version: 1.10.13
Show newest version
package io.jsync.spi.cluster.impl;


import com.hazelcast.config.Config;
import io.jsync.spi.AsyncSPI;
import io.jsync.spi.cluster.ClusterManager;
import io.jsync.spi.cluster.ClusterManagerFactory;

/**
 * Class to allow the programmatic configuration of a Hazelcast cluster in vert.x embedded.
 *
 * @author Dean Pehrsson-Chapman
 */
public class ProgrammableClusterManagerFactory implements ClusterManagerFactory {

    private volatile static Config config;

    /**
     * Sets the Config object to be used for clustering.  Call this method before creating the PlatformManager.
     */
    public static void setConfig(Config config) {
        ProgrammableClusterManagerFactory.config = config;
    }

    @Override
    public ClusterManager createClusterManager(AsyncSPI asyncSPI) {
        return new HazelcastClusterManager(asyncSPI) {
            @Override
            protected Config getConfig() {
                return config;
            }
        };
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy