Java 类com.hazelcast.config.properties.SimplePropertyDefinition 实例源码

项目:hazelcast-heroku-discovery    文件:HerokuDiscoveryStrategy.java   
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");
}
项目:hazelcast-consul-spi    文件:ConsulDiscoveryFactory.java   
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);
}
项目:hazelcast-consul-discovery    文件:ConsulDiscoveryFactory.java   
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);
}
项目:hazelcast-zookeeper    文件:ZookeeperDiscoveryProperties.java   
private static PropertyDefinition property(String key, PropertyTypeConverter typeConverter,
                                           ValueValidator valueValidator) {
    return new SimplePropertyDefinition(key, true, typeConverter, valueValidator);
}
项目:hazelcast-eureka    文件:EurekaOneProperties.java   
private static PropertyDefinition property(String key, TypeConverter typeConverter) {
    return new SimplePropertyDefinition(key, true, typeConverter);
}
项目:hazelcast-jclouds    文件:JCloudsProperties.java   
private static PropertyDefinition property(String key, PropertyTypeConverter typeConverter,
                                           ValueValidator valueValidator) {
    return new SimplePropertyDefinition(key, true, typeConverter, valueValidator);
}
项目:hzkeeper    文件:ZookeeperDiscoveryProperties.java   
private static PropertyDefinition property(String key, PropertyTypeConverter typeConverter,
                                           ValueValidator valueValidator) {
    return new SimplePropertyDefinition(key, true, typeConverter, valueValidator);
}
项目:hazelcast-kubernetes    文件:KubernetesProperties.java   
private static PropertyDefinition property(String key, TypeConverter typeConverter) {
    return new SimplePropertyDefinition(key, true, typeConverter);
}