Examples of ITopic


Examples of com.hazelcast.core.ITopic

public class HazelcastSerializedBroadcasterTest {

    @Test
    public void test() {
        HazelcastSerializedBroadcaster hazelcastSerializedBroadcaster = spy(new HazelcastSerializedBroadcaster());
        ITopic topic = mock(ITopic.class);
        when(hazelcastSerializedBroadcaster.getTopic()).thenReturn(topic);
        Object message = new Object();
        hazelcastSerializedBroadcaster.outgoingBroadcast(message);
        verify(hazelcastSerializedBroadcaster,times(1)).getTopic();
        verify(topic,times(1)).publish(message);
View Full Code Here

Examples of com.hazelcast.core.ITopic

            this.name = s;
        }
    }

    private List<Runnable> loadTopicOperations() {
        ITopic topic = hazelcast.getTopic("myTopic");
        topic.addMessageListener(new MessageListener() {
            public void onMessage(Message message) {
                messagesReceived.incrementAndGet();
            }
        });
        List<Runnable> operations = new ArrayList<Runnable>();
        addOperation(operations, new Runnable() {
            public void run() {
                ITopic topic = hazelcast.getTopic("myTopic");
                topic.publish(String.valueOf(random.nextInt(100000000)));
                messagesSend.incrementAndGet();
            }
        }, 10);
        return operations;
    }
View Full Code Here

Examples of com.hazelcast.core.ITopic

                        LocalQueueStatsImpl stats = (LocalQueueStatsImpl) queue.getLocalQueueStats();
                        memberState.putLocalQueueStats(queue.getName(), stats);
                        count++;
                    }
                } else if (distributedObject instanceof ITopic) {
                    ITopic topic = (ITopic) distributedObject;
                    if (config.findTopicConfig(topic.getName()).isStatisticsEnabled()) {
                        LocalTopicStatsImpl stats = (LocalTopicStatsImpl) topic.getLocalTopicStats();
                        memberState.putLocalTopicStats(topic.getName(), stats);
                        count++;
                    }
                } else if (distributedObject instanceof MultiMap) {
                    MultiMap multiMap = (MultiMap) distributedObject;
                    if (config.findMultiMapConfig(multiMap.getName()).isStatisticsEnabled()) {
View Full Code Here

Examples of com.hazelcast.core.ITopic

                    if (config.findQueueConfig(queue.getName()).isStatisticsEnabled()) {
                        setLongInstanceNames.add("q:" + queue.getName());
                        count++;
                    }
                } else if (distributedObject instanceof ITopic) {
                    ITopic topic = (ITopic) distributedObject;
                    if (config.findTopicConfig(topic.getName()).isStatisticsEnabled()) {
                        setLongInstanceNames.add("t:" + topic.getName());
                        count++;
                    }
                } else if (distributedObject instanceof IExecutorService) {
                    IExecutorService executorService = (IExecutorService) distributedObject;
                    if (config.findExecutorConfig(executorService.getName()).isStatisticsEnabled()) {
View Full Code Here

Examples of com.hazelcast.core.ITopic

    private ConfigurationAdmin configurationAdmin;

    @Override
    public EventProducer getEventProducer(String name, Boolean pubsub) {
        if (pubsub) {
            ITopic topic = instance.getTopic(Constants.TOPIC + Constants.SEPARATOR + name);
            TopicProducer producer = new TopicProducer();
            producer.setInstance(instance);
            producer.setTopic(topic);
            producer.setNode(getNode());
            producer.setConfigurationAdmin(configurationAdmin);
View Full Code Here

Examples of com.hazelcast.core.ITopic

    }

    @Override
    public EventConsumer getEventConsumer(String name, Boolean pubsub) {
        if (pubsub) {
            ITopic topic = instance.getTopic(Constants.TOPIC + Constants.SEPARATOR + name);
            TopicConsumer consumer = new TopicConsumer();
            consumer.setTopic(topic);
            consumer.setInstance(instance);
            consumer.setNode(getNode());
            consumer.setDispatcher(dispatcher);
View Full Code Here

Examples of com.hazelcast.core.ITopic

    private CombinedClassLoader combinedClassLoader;

    @Override
    public EventProducer getEventProducer(String name, Boolean pubsub) {
        if (pubsub) {
                ITopic topic = instance.getTopic(Constants.TOPIC + Constants.SEPARATOR + name);
                TopicProducer producer = new TopicProducer();
                producer.setInstance(instance);
                producer.setTopic(topic);
                producer.setNode(getNode());
                producer.init();
View Full Code Here

Examples of com.hazelcast.core.ITopic

    }

    @Override
    public EventConsumer getEventConsumer(String name, Boolean pubsub) {
        if (pubsub) {
                ITopic topic = instance.getTopic(Constants.TOPIC + Constants.SEPARATOR + name);
                TopicConsumer consumer = new TopicConsumer();
                consumer.setTopic(topic);
                consumer.setInstance(instance);
                consumer.setNode(getNode());
                consumer.setDispatcher(dispatcher);
View Full Code Here

Examples of com.hazelcast.core.ITopic

    public List getList(String listName) {
        return instance.getList(listName);
    }

    public EventProducer getEventProducer(String groupName) {
        ITopic topic = instance.getTopic(Constants.TOPIC + "." + groupName);
        TopicProducer producer = new TopicProducer();
        producer.setTopic(topic);
        producer.setNode(getNode());
        return producer;
    }
View Full Code Here

Examples of com.hazelcast.core.ITopic

    }

    public void registerGroup(Group group) {
        String groupName = group.getName();
        createGroup(groupName);
        ITopic topic = instance.getTopic(Constants.TOPIC + "." + groupName);

        Properties serviceProperties = new Properties();
        serviceProperties.put("type", "group");
        serviceProperties.put("name", groupName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.