本文整理汇总了Java中com.hazelcast.instance.HazelcastInstanceFactory类的典型用法代码示例。如果您正苦于以下问题:Java HazelcastInstanceFactory类的具体用法?Java HazelcastInstanceFactory怎么用?Java HazelcastInstanceFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HazelcastInstanceFactory类属于com.hazelcast.instance包,在下文中一共展示了HazelcastInstanceFactory类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: hazelcastInstance
import com.hazelcast.instance.HazelcastInstanceFactory; //导入依赖的package包/类
@PostConstruct
private HazelcastInstance hazelcastInstance() {
final Config config = new Config();
config.setInstanceName("iThingsDemo");
config.getNetworkConfig().setPort(5701);
config.getNetworkConfig().setPortAutoIncrement(true);
if (env.acceptsProfiles(Constants.SPRING_PROFILE_DEVELOPMENT)) {
System.setProperty("hazelcast.local.localAddress", "127.0.0.1");
config.getNetworkConfig().getJoin().getAwsConfig().setEnabled(false);
config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(false);
}
config.getMapConfigs().put("default", initializeDefaultMapConfig());
config.getMapConfigs().put("ch.ithings.demo.domain.*", initializeDomainMapConfig());
config.getMapConfigs().put("my-sessions", initializeClusteredSession());
hazelcastInstance = HazelcastInstanceFactory.newHazelcastInstance(config);
return hazelcastInstance;
}
开发者ID:thpham,项目名称:ithings-demo,代码行数:24,代码来源:CacheConfiguration.java
示例2: setUpHazelcast
import com.hazelcast.instance.HazelcastInstanceFactory; //导入依赖的package包/类
@BeforeClass
public static void setUpHazelcast() {
Config config = new Config();
config.setProperty("hazelcast.logging.type", "slf4j");
config.setInstanceName("providence-storage-hazelcast");
HazelcastStore_Factory.populateConfig(config, 1);
instance = HazelcastInstanceFactory.getOrCreateHazelcastInstance(config);
IMap<String, Integer> map = instance.getMap("test");
map.compute("test", (k, v) -> {
if (v == null) {
return 1;
}
return 1 + v;
});
}
开发者ID:morimekta,项目名称:providence,代码行数:16,代码来源:TestBase.java
注:本文中的com.hazelcast.instance.HazelcastInstanceFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论