Search in sources :

Example 21 with ReliableTopicConfig

use of com.hazelcast.config.ReliableTopicConfig in project hazelcast by hazelcast.

the class MemberDomConfigProcessor method handleReliableTopic.

protected void handleReliableTopic(Node node) {
    Node attName = getNamedItemNode(node, "name");
    String name = getTextContent(attName);
    ReliableTopicConfig topicConfig = new ReliableTopicConfig(name);
    handleReliableTopicNode(node, topicConfig);
}
Also used : ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) Node(org.w3c.dom.Node)

Example 22 with ReliableTopicConfig

use of com.hazelcast.config.ReliableTopicConfig in project hazelcast by hazelcast.

the class YamlMemberDomConfigProcessor method handleReliableTopic.

@Override
protected void handleReliableTopic(Node node) {
    for (Node topicNode : childElements(node)) {
        ReliableTopicConfig topicConfig = new ReliableTopicConfig();
        topicConfig.setName(topicNode.getNodeName());
        handleReliableTopicNode(topicNode, topicConfig);
    }
}
Also used : ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) Node(org.w3c.dom.Node) YamlNode(com.hazelcast.internal.yaml.YamlNode)

Example 23 with ReliableTopicConfig

use of com.hazelcast.config.ReliableTopicConfig in project hazelcast by hazelcast.

the class DynamicConfigXmlGenerator method reliableTopicXmlGenerator.

public static void reliableTopicXmlGenerator(ConfigXmlGenerator.XmlGenerator gen, Config config) {
    for (ReliableTopicConfig t : config.getReliableTopicConfigs().values()) {
        gen.open("reliable-topic", "name", t.getName()).node("statistics-enabled", t.isStatisticsEnabled()).node("read-batch-size", t.getReadBatchSize()).node("topic-overload-policy", t.getTopicOverloadPolicy());
        if (!t.getMessageListenerConfigs().isEmpty()) {
            gen.open("message-listeners");
            for (ListenerConfig lc : t.getMessageListenerConfigs()) {
                gen.node("message-listener", classNameOrImplClass(lc.getClassName(), lc.getImplementation()));
            }
            gen.close();
        }
        gen.close();
    }
}
Also used : ItemListenerConfig(com.hazelcast.config.ItemListenerConfig) CacheSimpleEntryListenerConfig(com.hazelcast.config.CacheSimpleEntryListenerConfig) ListenerConfig(com.hazelcast.config.ListenerConfig) EntryListenerConfig(com.hazelcast.config.EntryListenerConfig) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) MapPartitionLostListenerConfig(com.hazelcast.config.MapPartitionLostListenerConfig) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig)

Example 24 with ReliableTopicConfig

use of com.hazelcast.config.ReliableTopicConfig in project hazelcast by hazelcast.

the class ConfigSearchTest method testReliableTopicConfig_Dynamic.

@Test
public void testReliableTopicConfig_Dynamic() {
    TestCase<ReliableTopicConfig> testCase = new TestCase<ReliableTopicConfig>(new ReliableTopicConfig(STATIC_NAME), new ReliableTopicConfig(DYNAMIC_NAME), true) {

        @Override
        void addStaticConfig(Config config) {
            config.addReliableTopicConfig(this.staticConfig);
        }

        @Override
        void addDynamicConfig(HazelcastInstance hazelcastInstance) {
            hazelcastInstance.getConfig().addReliableTopicConfig(this.dynamicConfig);
        }

        @Override
        void asserts() {
            ReliableTopicConfig dataConfig = hazelcastInstance.getConfig().findReliableTopicConfig(DYNAMIC_NAME);
            assertThat(dataConfig.getName(), equalTo(DYNAMIC_NAME));
        }
    };
    testTemplate(testCase);
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) ListConfig(com.hazelcast.config.ListConfig) SetConfig(com.hazelcast.config.SetConfig) PNCounterConfig(com.hazelcast.config.PNCounterConfig) QueueConfig(com.hazelcast.config.QueueConfig) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) MapConfig(com.hazelcast.config.MapConfig) CardinalityEstimatorConfig(com.hazelcast.config.CardinalityEstimatorConfig) MultiMapConfig(com.hazelcast.config.MultiMapConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) ExecutorConfig(com.hazelcast.config.ExecutorConfig) ScheduledExecutorConfig(com.hazelcast.config.ScheduledExecutorConfig) TopicConfig(com.hazelcast.config.TopicConfig) Config(com.hazelcast.config.Config) DurableExecutorConfig(com.hazelcast.config.DurableExecutorConfig) FlakeIdGeneratorConfig(com.hazelcast.config.FlakeIdGeneratorConfig) ReplicatedMapConfig(com.hazelcast.config.ReplicatedMapConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 25 with ReliableTopicConfig

use of com.hazelcast.config.ReliableTopicConfig in project hazelcast by hazelcast.

the class DynamicConfigTest method assertConfigurationsEqualOnAllMembers.

private void assertConfigurationsEqualOnAllMembers(ReliableTopicConfig reliableTopicConfig) {
    String name = reliableTopicConfig.getName();
    for (HazelcastInstance instance : members) {
        ReliableTopicConfig registeredConfig = instance.getConfig().getReliableTopicConfig(name);
        assertEquals(reliableTopicConfig, registeredConfig);
    }
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig)

Aggregations

ReliableTopicConfig (com.hazelcast.config.ReliableTopicConfig)30 RingbufferConfig (com.hazelcast.config.RingbufferConfig)17 Config (com.hazelcast.config.Config)16 Test (org.junit.Test)15 HazelcastInstance (com.hazelcast.core.HazelcastInstance)14 QuickTest (com.hazelcast.test.annotation.QuickTest)14 ListenerConfig (com.hazelcast.config.ListenerConfig)13 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)13 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)6 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)6 DurableExecutorConfig (com.hazelcast.config.DurableExecutorConfig)6 ExecutorConfig (com.hazelcast.config.ExecutorConfig)6 FlakeIdGeneratorConfig (com.hazelcast.config.FlakeIdGeneratorConfig)6 ListConfig (com.hazelcast.config.ListConfig)6 MapConfig (com.hazelcast.config.MapConfig)6 MultiMapConfig (com.hazelcast.config.MultiMapConfig)6 PNCounterConfig (com.hazelcast.config.PNCounterConfig)6 QueueConfig (com.hazelcast.config.QueueConfig)6 ReplicatedMapConfig (com.hazelcast.config.ReplicatedMapConfig)6 ScheduledExecutorConfig (com.hazelcast.config.ScheduledExecutorConfig)6