
io.jsync.spi.cluster.impl.ProgrammableClusterManagerFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsync.io Show documentation
Show all versions of jsync.io Show documentation
jsync.io is a non-blocking, event-driven networking framework for Java
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