com.hazelcast.config.Config.addListenerConfig()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中com.hazelcast.config.Config.addListenerConfig()方法的一些代码示例,展示了Config.addListenerConfig()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.addListenerConfig()方法的具体详情如下:
包路径:com.hazelcast.config.Config
类名称:Config
方法名:addListenerConfig

Config.addListenerConfig介绍

[英]Adds a configuration for an EventListener. This includes listeners for events related to this instance/member or the cluster, such as partition, migration, cluster version listeners, etc. but not listeners on specific distributed data structures.
[中]添加EventListener的配置。这包括与此实例/成员或集群相关的事件的侦听器,如分区、迁移、集群版本侦听器等,但不包括特定分布式数据结构上的侦听器。

代码示例

代码示例来源:origin: com.hazelcast/hazelcast-all

@Override
public Config addListenerConfig(ListenerConfig listenerConfig) {
  return staticConfig.addListenerConfig(listenerConfig);
}

代码示例来源:origin: hazelcast/hazelcast-jet

@Override
public Config addListenerConfig(ListenerConfig listenerConfig) {
  return staticConfig.addListenerConfig(listenerConfig);
}

代码示例来源:origin: hazelcast/hazelcast-jet

private void handleListeners(Node node) {
  for (Node child : childElements(node)) {
    if ("listener".equals(cleanNodeName(child))) {
      String listenerClass = getTextContent(child);
      config.addListenerConfig(new ListenerConfig(listenerClass));
    }
  }
}

代码示例来源:origin: com.hazelcast/hazelcast-all

private void handleListeners(Node node) {
  for (Node child : childElements(node)) {
    if ("listener".equals(cleanNodeName(child))) {
      String listenerClass = getTextContent(child);
      config.addListenerConfig(new ListenerConfig(listenerClass));
    }
  }
}

代码示例来源:origin: com.hazelcast/hazelcast-wm

private static HazelcastInstance createInstance(ClusteredSessionService sessionService, WebFilterConfig filterConfig)
    throws ServletException {
  LOGGER.info("Creating a new HazelcastInstance for session replication");
  Config config;
  if (filterConfig.getConfigUrl() == null) {
    config = new XmlConfigBuilder().build();
  } else {
    try {
      config = new UrlXmlConfig(filterConfig.getConfigUrl());
    } catch (IOException e) {
      throw new ServletException(e);
    }
  }
  config.getMapConfig(filterConfig.getMapName()).setMaxIdleSeconds(filterConfig.getSessionTtlSeconds());
  config.addListenerConfig(new ListenerConfig(new ServerLifecycleListener(sessionService)));
  return Hazelcast.newHazelcastInstance(config);
}

代码示例来源:origin: com.hazelcast/hazelcast-all

private static HazelcastInstance createInstance(ClusteredSessionService sessionService, WebFilterConfig filterConfig)
    throws ServletException {
  LOGGER.info("Creating a new HazelcastInstance for session replication");
  Config config;
  if (filterConfig.getConfigUrl() == null) {
    config = new XmlConfigBuilder().build();
  } else {
    try {
      config = new UrlXmlConfig(filterConfig.getConfigUrl());
    } catch (IOException e) {
      throw new ServletException(e);
    }
  }
  config.getMapConfig(filterConfig.getMapName()).setMaxIdleSeconds(filterConfig.getSessionTtlSeconds());
  config.addListenerConfig(new ListenerConfig(new ServerLifecycleListener(sessionService)));
  return Hazelcast.newHazelcastInstance(config);
}

相关文章

Config类方法