Java 类com.hazelcast.config.ItemListenerConfig 实例源码

项目:microservices-sample    文件:HazelcastBuilder.java   
public HazelcastInstance build() {
    Config config = new Config();
    if (listener != null) {
        SetConfig setConfig = new SetConfig();
        setConfig.setName(PUBLISHED_SERVICES);
        setConfig.addItemListenerConfig(new ItemListenerConfig(listener, true));
        config.addSetConfig(setConfig);
    }
    config.setInstanceName(UUID.randomUUID().toString());

    return Hazelcast.newHazelcastInstance(config);
}
项目:hazelcast-archive    文件:BlockingQueueManager.java   
private void initializeListeners() {
    for (ItemListenerConfig lc : queueConfig.getItemListenerConfigs()) {
        try {
            node.listenerManager.createAndAddListenerItem(name, lc, Instance.InstanceType.QUEUE);
            for (MemberImpl member : node.clusterManager.getMembers()) {
                mapListeners.put(member.getAddress(), lc.isIncludeValue());
            }
        } catch (Exception e) {
            logger.log(Level.SEVERE, e.getMessage(), e);
        }
    }
}
项目:health-and-care-developer-network    文件:BlockingQueueManager.java   
private void initializeListeners() {
    for (ItemListenerConfig lc : queueConfig.getItemListenerConfigs()) {
        try {
            node.listenerManager.createAndAddListenerItem(name, lc, Instance.InstanceType.QUEUE);
            for (MemberImpl member : node.clusterManager.getMembers()) {
                mapListeners.put(member.getAddress(), lc.isIncludeValue());
            }
        } catch (Exception e) {
            logger.log(Level.SEVERE, e.getMessage(), e);
        }
    }
}