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


Java ClientConfig.setProperty方法代码示例

本文整理汇总了Java中com.hazelcast.client.config.ClientConfig.setProperty方法的典型用法代码示例。如果您正苦于以下问题:Java ClientConfig.setProperty方法的具体用法?Java ClientConfig.setProperty怎么用?Java ClientConfig.setProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.hazelcast.client.config.ClientConfig的用法示例。


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

示例1: HcConnectionStore

import com.hazelcast.client.config.ClientConfig; //导入方法依赖的package包/类
public HcConnectionStore(final String connectionString, final String groupName, final String mapName, final String host) {

		final ClientConfig clientConfig = new ClientConfig();
		clientConfig.setProperty("hazelcast.logging.type", "slf4j");
		clientConfig.getNetworkConfig().setAddresses(LangUtil.splitCsStrings(Preconditions.checkNotNull(connectionString)));
		clientConfig.getGroupConfig().setName(Preconditions.checkNotNull(groupName));
		this.hazelcastClient = HazelcastClient.newHazelcastClient(clientConfig);

		this.mapName = Preconditions.checkNotNull(mapName);
		this.host = Preconditions.checkNotNull(host);
	}
 
开发者ID:dcsolutions,项目名称:kalinka,代码行数:12,代码来源:HcConnectionStore.java

示例2: createClientConfig

import com.hazelcast.client.config.ClientConfig; //导入方法依赖的package包/类
private ClientConfig createClientConfig(String zookeeperURL) {
    DiscoveryStrategyConfig discoveryStrategyConfig = createDiscoveryConfig(zookeeperURL);
    ClientConfig clientConfig = new ClientConfig();
    clientConfig.setProperty("hazelcast.discovery.enabled", "true");
    clientConfig.getNetworkConfig().getDiscoveryConfig().addDiscoveryStrategyConfig(discoveryStrategyConfig);
    return clientConfig;
}
 
开发者ID:hazelcast,项目名称:hazelcast-zookeeper,代码行数:8,代码来源:ClientSmokeTest.java

示例3: getHazelcastInstance

import com.hazelcast.client.config.ClientConfig; //导入方法依赖的package包/类
public synchronized HazelcastInstance getHazelcastInstance(HazelcastConfig configuration) {
    if (hazelcastInstance == null) {
        final String serverName = configuration.getServerName();
        final String serverPort = configuration.getServerPort();
        final String groupName = configuration.getGroupName();

        LOG.debug("Hazelcast server name: {}", serverName);
        LOG.debug("Hazelcast server port: {}", serverPort);
        LOG.debug("Hazelcast group name: {}", groupName);

        final ClientConfig clientConfig = new ClientConfig();
        clientConfig.getNetworkConfig().setConnectionAttemptLimit(configuration.getConnectionAttemptLimit());
        clientConfig.getNetworkConfig().setConnectionAttemptPeriod(configuration.getConnectionAttemptPeriod());
        clientConfig.getNetworkConfig().setConnectionTimeout(configuration.getConnectionTimeout());
        clientConfig.getNetworkConfig().addAddress(serverName + ":" + serverPort);
        clientConfig.getGroupConfig().setName(groupName);
        clientConfig.setProperty(LOGGER_PROPERTY_NAME, LOGGER_PROPERTY_SLF4J_TYPE);

        final SerializerConfig dolphinEventSerializerConfig = new SerializerConfig().
                setImplementation(new EventStreamSerializer()).setTypeClass(DolphinEvent.class);

        clientConfig.getSerializationConfig().getSerializerConfigs().add(dolphinEventSerializerConfig);


        hazelcastInstance = HazelcastClient.newHazelcastClient(clientConfig);
    }
    return hazelcastInstance;
}
 
开发者ID:canoo,项目名称:dolphin-platform,代码行数:29,代码来源:DefaultHazelcastProvider.java

示例4: beforeClass

import com.hazelcast.client.config.ClientConfig; //导入方法依赖的package包/类
@BeforeClass
public static void beforeClass() {
    Config config = new Config();
    config.setProperty("hazelcast.partition.count", "" + PARTITION_COUNT);

    hz = newHazelcastInstance(config);
    HazelcastInstance remoteInstance = newHazelcastInstance(config);
    warmupPartitions(hz);
    warmupPartitions(remoteInstance);

    ClientConfig clientconfig = new ClientConfig();
    clientconfig.setProperty("hazelcast.partition.count", "" + PARTITION_COUNT);

    client = HazelcastClient.newHazelcastClient(clientconfig);
}
 
开发者ID:hazelcast,项目名称:hazelcast-simulator,代码行数:16,代码来源:KeyUtilsTest.java

示例5: hazelcast

import com.hazelcast.client.config.ClientConfig; //导入方法依赖的package包/类
@Bean
public HazelcastInstance hazelcast() throws Exception {
    ClientConfig clientConfig = new ClientConfig();
    clientConfig.getGroupConfig()
            .setName(groupName)
            .setPassword(groupPassword);
    clientConfig.getNetworkConfig()
            .setAddresses(clusterMembers);
    clientConfig.getSerializationConfig()
            .addPortableFactory(1, new DevicePortableFactory());
    clientConfig.setProperty("hazelcast.client.event.thread.count", eventThreadCount);

    return HazelcastClient.newHazelcastClient(clientConfig);
}
 
开发者ID:devicehive,项目名称:devicehive-java-server,代码行数:15,代码来源:HazelcastConfiguration.java


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