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


Java PropertyDefinition类代码示例

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


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

示例1: discoveryStrategyFactory

import com.hazelcast.config.properties.PropertyDefinition; //导入依赖的package包/类
@Bean
public DiscoveryStrategyFactory discoveryStrategyFactory () {
    return new DiscoveryStrategyFactory() {

        @Override
        public Class<? extends DiscoveryStrategy> getDiscoveryStrategyType () {
            return EurekaDiscoveryStrategy.class;
        }

        @Override
        public DiscoveryStrategy newDiscoveryStrategy (DiscoveryNode discoveryNode,
                                                       ILogger logger,
                                                       Map<String, Comparable> properties
        ) {
            val eurekaDiscoveryStrategy = new EurekaDiscoveryStrategy(logger, emptyMap());
            eurekaDiscoveryStrategy.setDiscoveryClient(discoveryClient);
            eurekaDiscoveryStrategy.setHaselcastNodeServiceId(applicationName);
            return eurekaDiscoveryStrategy;
        }

        @Override
        public Collection<PropertyDefinition> getConfigurationProperties () {
            return null;
        }
    };
}
 
开发者ID:xxlabaza,项目名称:hazelcast_eureka,代码行数:27,代码来源:HazelcastMemberConfiguration.java

示例2: getOrDefault

import com.hazelcast.config.properties.PropertyDefinition; //导入依赖的package包/类
protected <T extends Comparable> T getOrDefault(Map<String, Comparable> properties, String prefix,
                                                PropertyDefinition property, T defaultValue) {
    if (property == null) {
        return defaultValue;
    }

    Comparable value = readProperty(prefix, property);
    if (value == null) {
        value = properties.get(property.key());
    }

    if (value == null) {
        return defaultValue;
    }

    return (T) value;
}
 
开发者ID:hazelcast,项目名称:hazelcast-kubernetes,代码行数:18,代码来源:HazelcastKubernetesDiscoveryStrategy.java

示例3: readProperty

import com.hazelcast.config.properties.PropertyDefinition; //导入依赖的package包/类
private Comparable readProperty(String prefix, PropertyDefinition property) {
    if (prefix != null) {
        String p = getProperty(prefix, property);
        String v = System.getProperty(p);
        if (StringUtil.isNullOrEmpty(v)) {
            v = System.getenv(p);
            if (StringUtil.isNullOrEmpty(v)) {
                v = System.getenv(cIdentifierLike(p));
            }
        }

        if (!StringUtil.isNullOrEmpty(v)) {
            return property.typeConverter().convert(v);
        }
    }
    return null;
}
 
开发者ID:hazelcast,项目名称:hazelcast-kubernetes,代码行数:18,代码来源:HazelcastKubernetesDiscoveryStrategy.java

示例4: getConfigurationProperties

import com.hazelcast.config.properties.PropertyDefinition; //导入依赖的package包/类
@Override
public Collection<PropertyDefinition> getConfigurationProperties() {
    final AwsProperties[] props = AwsProperties.values();
    final ArrayList<PropertyDefinition> definitions = new ArrayList<PropertyDefinition>(props.length);
    for (AwsProperties prop : props) {
        definitions.add(prop.getDefinition());
    }
    return definitions;
}
 
开发者ID:hazelcast,项目名称:hazelcast-aws,代码行数:10,代码来源:AwsDiscoveryStrategyFactory.java

示例5: parseDiscoveryStrategyConfigPasses

import com.hazelcast.config.properties.PropertyDefinition; //导入依赖的package包/类
@Test
public void parseDiscoveryStrategyConfigPasses() {
    final AwsDiscoveryStrategyFactory factory = new AwsDiscoveryStrategyFactory();
    final Config config = createConfig("test-aws-config.xml");
    final JoinConfig joinConfig = config.getNetworkConfig().getJoin();

    assertFalse(joinConfig.getAwsConfig().isEnabled());
    assertFalse(joinConfig.getTcpIpConfig().isEnabled());
    assertFalse(joinConfig.getMulticastConfig().isEnabled());

    final DiscoveryConfig discoveryConfig = joinConfig.getDiscoveryConfig();

    assertTrue(discoveryConfig.isEnabled());
    assertEquals(1, discoveryConfig.getDiscoveryStrategyConfigs().size());

    final DiscoveryStrategyConfig providerConfig = discoveryConfig.getDiscoveryStrategyConfigs().iterator().next();
    final Map<String, Comparable> providerProperties = providerConfig.getProperties();
    final Collection<PropertyDefinition> factoryConfigProperties = factory.getConfigurationProperties();

    assertEquals(factory.getDiscoveryStrategyType(), AwsDiscoveryStrategy.class);
    assertEquals(AwsDiscoveryStrategy.class.getName(), providerConfig.getClassName());
    assertEquals(factoryConfigProperties.size(), providerProperties.size());
    for (AwsProperties prop : AwsProperties.values()) {
        assertTrue(factoryConfigProperties.contains(prop.getDefinition()));
    }

    assertEquals("test-access-key", providerProperties.get("access-key"));
    assertEquals("test-secret-key", providerProperties.get("secret-key"));
    assertEquals("test-region", providerProperties.get("region"));
    assertEquals("test-iam-role", providerProperties.get("iam-role"));
    assertEquals("ec2.test-host-header", providerProperties.get("host-header"));
    assertEquals("test-security-group-name", providerProperties.get("security-group-name"));
    assertEquals("test-tag-key", providerProperties.get("tag-key"));
    assertEquals("test-tag-value", providerProperties.get("tag-value"));
    assertEquals("10", providerProperties.get("connection-timeout-seconds"));
    assertEquals("5702", providerProperties.get("hz-port"));
}
 
开发者ID:hazelcast,项目名称:hazelcast-aws,代码行数:38,代码来源:AwsDiscoveryStrategyFactoryTest.java

示例6: getOrDefault

import com.hazelcast.config.properties.PropertyDefinition; //导入依赖的package包/类
private <T extends Comparable> T getOrDefault(PropertyDefinition property, T defaultValue) {
    if (properties == null || property == null) {
        return defaultValue;
    }

    Comparable value = properties.get(property.key());
    if (value == null) {
        return defaultValue;
    }
    return (T) value;
}
 
开发者ID:hazelcast,项目名称:hazelcast-jclouds,代码行数:12,代码来源:ComputeServiceBuilder.java

示例7: ConsulDiscoveryFactory

import com.hazelcast.config.properties.PropertyDefinition; //导入依赖的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

示例8: getProperty

import com.hazelcast.config.properties.PropertyDefinition; //导入依赖的package包/类
private String getProperty(String prefix, PropertyDefinition property) {
    StringBuilder sb = new StringBuilder(prefix);
    if (prefix.charAt(prefix.length() - 1) != '.') {
        sb.append('.');
    }
    return sb.append(property.key()).toString();
}
 
开发者ID:hazelcast,项目名称:hazelcast-kubernetes,代码行数:8,代码来源:HazelcastKubernetesDiscoveryStrategy.java

示例9: checkProperties

import com.hazelcast.config.properties.PropertyDefinition; //导入依赖的package包/类
@Test
public void checkProperties() {
    HazelcastKubernetesDiscoveryStrategyFactory factory = new HazelcastKubernetesDiscoveryStrategyFactory();
    Collection<PropertyDefinition> propertyDefinitions = factory.getConfigurationProperties();
    assertTrue(propertyDefinitions.contains(KubernetesProperties.SERVICE_DNS));
    assertTrue(propertyDefinitions.contains(KubernetesProperties.SERVICE_PORT));
}
 
开发者ID:hazelcast,项目名称:hazelcast-kubernetes,代码行数:8,代码来源:KubernetesDiscoveryStrategyFactoryTest.java

示例10: getConfigurationProperties

import com.hazelcast.config.properties.PropertyDefinition; //导入依赖的package包/类
public Collection<PropertyDefinition> getConfigurationProperties() {
	return PROPERTIES;
}
 
开发者ID:bitsofinfo,项目名称:hazelcast-docker-swarm-discovery-spi,代码行数:4,代码来源:DockerSwarmDiscoveryStrategyFactory.java

示例11: property

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

示例12: getConfigurationProperties

import com.hazelcast.config.properties.PropertyDefinition; //导入依赖的package包/类
public Collection<PropertyDefinition> getConfigurationProperties() {
    return PROPERTY_DEFINITIONS;
}
 
开发者ID:hazelcast,项目名称:hazelcast-zookeeper,代码行数:4,代码来源:ZookeeperDiscoveryStrategyFactory.java

示例13: getConfigurationProperties

import com.hazelcast.config.properties.PropertyDefinition; //导入依赖的package包/类
@Override
public Collection<PropertyDefinition> getConfigurationProperties() {
    return PROPERTY_DEFINITIONS;
}
 
开发者ID:noctarius,项目名称:hazelcast-discovery-spi-demonstration,代码行数:5,代码来源:SomeRestServiceDiscoveryStrategyFactory.java

示例14: property

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

示例15: HerokuDiscoveryStrategyFactory

import com.hazelcast.config.properties.PropertyDefinition; //导入依赖的package包/类
public HerokuDiscoveryStrategyFactory() {
  this.propertyDefinitions = Collections.unmodifiableCollection(
      new ArrayList<PropertyDefinition>()
  );
}
 
开发者ID:jkutner,项目名称:hazelcast-heroku-discovery,代码行数:6,代码来源:HerokuDiscoveryStrategyFactory.java


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