当前位置: 首页>>代码示例>>Java>>正文


Java PropertyTypeConverter类代码示例

本文整理汇总了Java中com.hazelcast.config.properties.PropertyTypeConverter的典型用法代码示例。如果您正苦于以下问题:Java PropertyTypeConverter类的具体用法?Java PropertyTypeConverter怎么用?Java PropertyTypeConverter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PropertyTypeConverter类属于com.hazelcast.config.properties包,在下文中一共展示了PropertyTypeConverter类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: HerokuDiscoveryStrategy

import com.hazelcast.config.properties.PropertyTypeConverter; //导入依赖的package包/类
public HerokuDiscoveryStrategy(ILogger logger, Map<String, Comparable> properties) {
  super(logger, properties);

  String serviceNamesProp = getOrNull(new SimplePropertyDefinition("serviceNames", PropertyTypeConverter.STRING));
  if (serviceNamesProp == null) {
    String formationName = System.getenv("HEROKU_DNS_FORMATION_NAME");
    if (formationName == null) {
      throw new IllegalArgumentException("You must enable Heroku DNS Service Discovery for this Hazelcast plugin to work!");
    } else {
      this.serviceNames = Collections.unmodifiableCollection(Arrays.asList(formationName));
    }
  } else {
    List<String> serviceNamesList = new ArrayList<>();
    for (String serviceName : serviceNamesProp.split(";")) {
      String appName = System.getenv("HEROKU_DNS_APP_NAME");
      if (appName == null) {
        throw new IllegalArgumentException("You must enable Heroku DNS Service Discovery for this Hazelcast plugin to work!");
      } else {
        serviceNamesList.add(serviceName + "." + appName);
      }
    }
    this.serviceNames = Collections.unmodifiableCollection(serviceNamesList);
  }

  String mergeDelay = getOrNull(new SimplePropertyDefinition("mergeDelay", PropertyTypeConverter.STRING));
  System.setProperty("hazelcast.merge.first.run.delay.seconds", mergeDelay == null ? "20" : mergeDelay);

  // TODO parse /etc/heroku/space-topology.json instead,
  // but that should go in a separate library
  Security.setProperty("networkaddress.cache.ttl", "20");
  Security.setProperty("networkaddress.cache.negative.ttl", "0");
}
 
开发者ID:jkutner,项目名称:hazelcast-heroku-discovery,代码行数:33,代码来源:HerokuDiscoveryStrategy.java

示例2: ConsulDiscoveryFactory

import com.hazelcast.config.properties.PropertyTypeConverter; //导入依赖的package包/类
public ConsulDiscoveryFactory() {
    List<PropertyDefinition> properties = new ArrayList<>();
    properties.add(new SimplePropertyDefinition("host", PropertyTypeConverter.STRING));
    properties.add(new SimplePropertyDefinition("port", PropertyTypeConverter.INTEGER));
    properties.add(new SimplePropertyDefinition("name", PropertyTypeConverter.STRING));
    this.propertyDefinitions = Collections.unmodifiableCollection(properties);
}
 
开发者ID:decoomanj,项目名称:hazelcast-consul-spi,代码行数:8,代码来源:ConsulDiscoveryFactory.java

示例3: property

import com.hazelcast.config.properties.PropertyTypeConverter; //导入依赖的package包/类
private static PropertyDefinition property(String key, PropertyTypeConverter typeConverter) {
    return property(key, typeConverter, null);
}
 
开发者ID:hazelcast,项目名称:hazelcast-zookeeper,代码行数:4,代码来源:ZookeeperDiscoveryProperties.java


注:本文中的com.hazelcast.config.properties.PropertyTypeConverter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。