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

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

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

Config.getServicesConfig介绍

[英]Returns the configuration for the user services managed by this hazelcast instance.
[中]返回此hazelcast实例管理的用户服务的配置。

代码示例

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

@Override
public ServicesConfig getServicesConfig() {
  return staticConfig.getServicesConfig();
}

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

@Override
public ServicesConfig getServicesConfig() {
  return staticConfig.getServicesConfig();
}

代码示例来源:origin: hazelcast/hazelcast-code-samples

/**
 * Load Hazelcast configuration from the standard
 * file "{@code hazelcast.xml}" then extend it with
 * the custom service.
 *
 * @return Configuration to build a Hazelcast server
 */
@Bean
public Config config() {
  Config config = new ClasspathXmlConfig("hazelcast.xml");
  // Record the custom service class
  ServiceConfig serviceConfig = new ServiceConfig();
  serviceConfig.setEnabled(true);
  serviceConfig.setName(MyPriorityQueueService.class.getSimpleName());
  serviceConfig.setClassName(MyPriorityQueueService.class.getName());
  // Add it to overall config
  config.getServicesConfig().addServiceConfig(serviceConfig);
  return config;
}

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

private void registerServices(Map<String, Properties> serviceProps, Map<String, Object> serviceConfigObjects) {
  registerCoreServices();
  registerExtensionServices();
  Node node = nodeEngine.getNode();
  ServicesConfig servicesConfig = node.getConfig().getServicesConfig();
  if (servicesConfig != null) {
    registerDefaultServices(servicesConfig);
    registerUserServices(servicesConfig, serviceProps, serviceConfigObjects);
  }
}

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

private void registerServices(Map<String, Properties> serviceProps, Map<String, Object> serviceConfigObjects) {
  registerCoreServices();
  registerExtensionServices();
  Node node = nodeEngine.getNode();
  ServicesConfig servicesConfig = node.getConfig().getServicesConfig();
  if (servicesConfig != null) {
    registerDefaultServices(servicesConfig);
    registerUserServices(servicesConfig, serviceProps, serviceConfigObjects);
  }
}

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

private void handleServices(Node node) {
  Node attDefaults = node.getAttributes().getNamedItem("enable-defaults");
  boolean enableDefaults = attDefaults == null || getBooleanValue(getTextContent(attDefaults));
  ServicesConfig servicesConfig = config.getServicesConfig();
  servicesConfig.setEnableDefaults(enableDefaults);

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

private void handleServices(Node node) {
  Node attDefaults = node.getAttributes().getNamedItem("enable-defaults");
  boolean enableDefaults = attDefaults == null || getBooleanValue(getTextContent(attDefaults));
  ServicesConfig servicesConfig = config.getServicesConfig();
  servicesConfig.setEnableDefaults(enableDefaults);

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

hzConfig.getServicesConfig()
    .addServiceConfig(new ServiceConfig()
        .setEnabled(true)

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

private static void servicesXmlGenerator(XmlGenerator gen, Config config) {
  ServicesConfig c = config.getServicesConfig();
  if (c == null) {
    return;
  }
  gen.open("services", "enable-defaults", c.isEnableDefaults());
  if (CollectionUtil.isNotEmpty(c.getServiceConfigs())) {
    for (ServiceConfig serviceConfig : c.getServiceConfigs()) {
      gen.open("service", "enabled", serviceConfig.isEnabled())
          .node("name", serviceConfig.getName())
          .node("class-name", classNameOrImplClass(serviceConfig.getClassName(), serviceConfig.getImplementation()))
          .appendProperties(serviceConfig.getProperties())
          .close();
    }
  }
  gen.close();
}

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

private static void servicesXmlGenerator(XmlGenerator gen, Config config) {
  ServicesConfig c = config.getServicesConfig();
  if (c == null) {
    return;
  }
  gen.open("services", "enable-defaults", c.isEnableDefaults());
  if (CollectionUtil.isNotEmpty(c.getServiceConfigs())) {
    for (ServiceConfig serviceConfig : c.getServiceConfigs()) {
      gen.open("service", "enabled", serviceConfig.isEnabled())
          .node("name", serviceConfig.getName())
          .node("class-name", classNameOrImplClass(serviceConfig.getClassName(), serviceConfig.getImplementation()))
          .appendProperties(serviceConfig.getProperties())
          .close();
    }
  }
  gen.close();
}

相关文章

Config类方法