Search in sources :

Example 16 with SemaphoreConfig

use of com.hazelcast.config.cp.SemaphoreConfig in project hazelcast by hazelcast.

the class UnsafeSemaphoreAdvancedTest method createConfig.

private Config createConfig() {
    Config config = new Config();
    CPSubsystemConfig cpSubsystemConfig = config.getCPSubsystemConfig();
    cpSubsystemConfig.setSessionTimeToLiveSeconds(10);
    cpSubsystemConfig.setSessionHeartbeatIntervalSeconds(1);
    SemaphoreConfig semaphoreConfig = new SemaphoreConfig();
    semaphoreConfig.setName(objectName);
    cpSubsystemConfig.addSemaphoreConfig(semaphoreConfig);
    return config;
}
Also used : Config(com.hazelcast.config.Config) SemaphoreConfig(com.hazelcast.config.cp.SemaphoreConfig) CPSubsystemConfig(com.hazelcast.config.cp.CPSubsystemConfig) SemaphoreConfig(com.hazelcast.config.cp.SemaphoreConfig) CPSubsystemConfig(com.hazelcast.config.cp.CPSubsystemConfig)

Example 17 with SemaphoreConfig

use of com.hazelcast.config.cp.SemaphoreConfig in project hazelcast by hazelcast.

the class UnsafeSessionAwareSemaphoreBasicTest method createInstances.

@Override
protected HazelcastInstance[] createInstances() {
    Config config = new Config();
    SemaphoreConfig semaphoreConfig = new SemaphoreConfig(objectName);
    semaphoreConfig.setName(objectName);
    config.getCPSubsystemConfig().addSemaphoreConfig(semaphoreConfig);
    return factory.newInstances(config, 2);
}
Also used : Config(com.hazelcast.config.Config) SemaphoreConfig(com.hazelcast.config.cp.SemaphoreConfig) SemaphoreConfig(com.hazelcast.config.cp.SemaphoreConfig)

Example 18 with SemaphoreConfig

use of com.hazelcast.config.cp.SemaphoreConfig in project hazelcast by hazelcast.

the class SessionAwareSemaphoreBasicTest method createConfig.

@Override
protected Config createConfig(int cpNodeCount, int groupSize) {
    Config config = super.createConfig(cpNodeCount, groupSize);
    SemaphoreConfig semaphoreConfig = new SemaphoreConfig();
    semaphoreConfig.setName(objectName);
    config.getCPSubsystemConfig().addSemaphoreConfig(semaphoreConfig);
    return config;
}
Also used : Config(com.hazelcast.config.Config) SemaphoreConfig(com.hazelcast.config.cp.SemaphoreConfig) SemaphoreConfig(com.hazelcast.config.cp.SemaphoreConfig)

Example 19 with SemaphoreConfig

use of com.hazelcast.config.cp.SemaphoreConfig in project hazelcast by hazelcast.

the class UnsafeSemaphoreFailureTest method createInstances.

@Override
protected HazelcastInstance[] createInstances() {
    Config config = new Config();
    SemaphoreConfig semaphoreConfig = new SemaphoreConfig(objectName, isJDKCompatible(), 0);
    config.getCPSubsystemConfig().addSemaphoreConfig(semaphoreConfig);
    return factory.newInstances(config, 2);
}
Also used : Config(com.hazelcast.config.Config) SemaphoreConfig(com.hazelcast.config.cp.SemaphoreConfig) SemaphoreConfig(com.hazelcast.config.cp.SemaphoreConfig)

Aggregations

SemaphoreConfig (com.hazelcast.config.cp.SemaphoreConfig)19 Config (com.hazelcast.config.Config)9 CPSubsystemConfig (com.hazelcast.config.cp.CPSubsystemConfig)8 FencedLockConfig (com.hazelcast.config.cp.FencedLockConfig)5 RaftAlgorithmConfig (com.hazelcast.config.cp.RaftAlgorithmConfig)4 QuickTest (com.hazelcast.test.annotation.QuickTest)4 File (java.io.File)4 Test (org.junit.Test)4 KerberosAuthenticationConfig (com.hazelcast.config.security.KerberosAuthenticationConfig)3 KerberosIdentityConfig (com.hazelcast.config.security.KerberosIdentityConfig)3 LdapAuthenticationConfig (com.hazelcast.config.security.LdapAuthenticationConfig)3 RealmConfig (com.hazelcast.config.security.RealmConfig)3 SimpleAuthenticationConfig (com.hazelcast.config.security.SimpleAuthenticationConfig)3 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)3 TokenIdentityConfig (com.hazelcast.config.security.TokenIdentityConfig)2 File.createTempFile (java.io.File.createTempFile)2 Node (org.w3c.dom.Node)2 CPSubsystemConfigChecker (com.hazelcast.config.ConfigCompatibilityChecker.CPSubsystemConfigChecker)1 JaasAuthenticationConfig (com.hazelcast.config.security.JaasAuthenticationConfig)1 TlsAuthenticationConfig (com.hazelcast.config.security.TlsAuthenticationConfig)1