com.hazelcast.config.Config.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(211)

本文整理了Java中com.hazelcast.config.Config.<init>()方法的一些代码示例,展示了Config.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.<init>()方法的具体详情如下:
包路径:com.hazelcast.config.Config
类名称:Config
方法名:<init>

Config.<init>介绍

暂无

代码示例

代码示例来源:origin: primefaces/primefaces

public HazelcastCacheProvider() {
  Config config = new Config();
  hazelcastInstance = Hazelcast.newHazelcastInstance(config);
}

代码示例来源:origin: jooby-project/jooby

@Override
public void configure(final Env env, final Config conf, final Binder binder) {
 com.hazelcast.config.Config config = new com.hazelcast.config.Config();
 config.setProperties(toProperties(conf.getConfig("hazelcast")));
 if (configurer != null) {
  configurer.accept(config, conf);
 }
 HazelcastInstance hcast = Hazelcast.newHazelcastInstance(config);
 binder.bind(com.hazelcast.config.Config.class).toInstance(config);
 binder.bind(HazelcastInstance.class).toInstance(hcast);
 env.onStop(hcast::shutdown);
}

代码示例来源:origin: spring-projects/spring-session

@Test
@SuppressWarnings("unused")
public void newHazelcastSessionRepository() {
  // tag::new-hazelcastsessionrepository[]
  Config config = new Config();
  // ... configure Hazelcast ...
  HazelcastInstance hazelcastInstance = Hazelcast.newHazelcastInstance(config);
  HazelcastSessionRepository repository =
      new HazelcastSessionRepository(hazelcastInstance);
  // end::new-hazelcastsessionrepository[]
}

代码示例来源:origin: paascloud/paascloud-master

/**
 * Hazelcast config config.
 *
 * @return the config
 */
@Bean
public Config hazelcastConfig() {
  return new Config().setProperty("hazelcast.jmx", "true")
      .addMapConfig(new MapConfig("spring-boot-admin-application-store").setBackupCount(1)
          .setEvictionPolicy(EvictionPolicy.NONE))
      .addListConfig(new ListConfig("spring-boot-admin-event-store").setBackupCount(1)
          .setMaxSize(1000));
}

代码示例来源:origin: spring-projects/spring-session

@Bean
public HazelcastInstance hazelcastInstance() {
  MapAttributeConfig attributeConfig = new MapAttributeConfig()
      .setName(HazelcastSessionRepository.PRINCIPAL_NAME_ATTRIBUTE)
      .setExtractor(PrincipalNameExtractor.class.getName());
  Config config = new Config();
  config.getMapConfig(HazelcastSessionRepository.DEFAULT_SESSION_MAP_NAME) // <2>
      .addMapAttributeConfig(attributeConfig)
      .addMapIndexConfig(new MapIndexConfig(
          HazelcastSessionRepository.PRINCIPAL_NAME_ATTRIBUTE, false));
  return Hazelcast.newHazelcastInstance(config); // <3>
}

代码示例来源:origin: stackoverflow.com

@Configuration
public class BadSpringConfig {
   @Lazy @Bean public Config config() { return new Config(); }
   @Lazy @Bean public FooPP fooPP() { return new FooPP(); }
}

代码示例来源:origin: SonarSource/sonarqube

public HazelcastMember build() {
 Config config = new Config();

代码示例来源:origin: stackoverflow.com

Config Conf = new Config();
 Log.info("Loading server.conf");
 Conf.doConfig();

代码示例来源:origin: stackoverflow.com

Config config = new Config(); 
config.setProperty("hazelcast.initial.min.cluster.size","3");

代码示例来源:origin: spring-projects/spring-integration

@Bean
public HazelcastInstance hazelcastInstance() {
  return Hazelcast.newHazelcastInstance(new Config().setProperty("hazelcast.logging.type", "slf4j"));
}

代码示例来源:origin: apiman/apiman

/**
 * Constructor.
 */
public AbstractHazelcastComponent(String storeName) {
  this(storeName, new Config());
}

代码示例来源:origin: hazelcast/hazelcast-code-samples

public static void main(String[] args) {
    Config config = new Config();
    config.setLiteMember(true);

    Hazelcast.newHazelcastInstance(config);
  }
}

代码示例来源:origin: hazelcast/hazelcast-code-samples

@Bean
  public HazelcastInstance instance() {
    Config config = new Config();
    config.setManagedContext(managedContext());
    return Hazelcast.newHazelcastInstance(config);
  }
}

代码示例来源:origin: hazelcast/hazelcast-code-samples

@Bean
  public HazelcastInstance instance() {
    Map<String, CacheSimpleConfig> cacheConfigs = new HashMap<String, CacheSimpleConfig>();
    cacheConfigs.put("city", new CacheSimpleConfig().setName("city"));
    Config config = new Config().setCacheConfigs(cacheConfigs);
    return Hazelcast.newHazelcastInstance(config);
  }
}

代码示例来源:origin: stackoverflow.com

//You need to do this once on each JVM(Hazelcast node) at the begining  
Config myConfig = new Config();
Map<String, MapConfig> myHazelcastMapConfigs = myConfig.getMapMapConfigs();
MapConfig myMapConfig = new MapConfig();
myMapConfig.setName("myMapName");
myMapConfig.setTimeToLiveSeconds(1000);
myHazelcastMapConfigs.put("myMapName", myMapConfig);
Hazelcast.init(myConfig);

代码示例来源:origin: hazelcast/hazelcast-code-samples

public static void main(String[] args) {
    Config config = new Config();
    config.getSerializationConfig().setGlobalSerializerConfig(
        new GlobalSerializerConfig().setImplementation(new GlobalSerializer())
    );
    // Start the Embedded Hazelcast Cluster Member.
    HazelcastInstance hz = Hazelcast.newHazelcastInstance(config);
    //GlobalSerializer will serialize/deserialize all non-builtin types
    hz.shutdown();
  }
}

代码示例来源:origin: hazelcast/hazelcast-code-samples

private static Config createConfig() {
  Config config = new Config();
  config.setLicenseKey(ENTERPRISE_LICENSE_KEY);
  config.setProperty("hazelcast.wait.seconds.before.join", "0");
  SocketInterceptorConfig interceptorConfig = new SocketInterceptorConfig();
  interceptorConfig.setEnabled(true).setClassName(MySocketInterceptor.class.getName());
  config.getNetworkConfig().setSocketInterceptorConfig(interceptorConfig);
  return config;
}

代码示例来源:origin: hazelcast/hazelcast-code-samples

private static Config createConfig() {
  Config config = new Config();
  config.setLicenseKey(ENTERPRISE_LICENSE_KEY);
  config.setProperty("hazelcast.wait.seconds.before.join", "0");
  SocketInterceptorConfig interceptorConfig = new SocketInterceptorConfig();
  interceptorConfig.setEnabled(true).setClassName(MySocketInterceptor.class.getName());
  config.getNetworkConfig().setSocketInterceptorConfig(interceptorConfig);
  return config;
}

代码示例来源:origin: hazelcast/hazelcast-code-samples

private static HazelcastInstance buildCluster(int memberCount) {
  Config config = new Config();
  NetworkConfig networkConfig = config.getNetworkConfig();
  networkConfig.getJoin().getMulticastConfig().setEnabled(false);
  networkConfig.getJoin().getTcpIpConfig().setEnabled(true);
  networkConfig.getJoin().getTcpIpConfig().setMembers(singletonList("127.0.0.1"));
  HazelcastInstance[] hazelcastInstances = new HazelcastInstance[memberCount];
  for (int i = 0; i < memberCount; i++) {
    hazelcastInstances[i] = Hazelcast.newHazelcastInstance(config);
  }
  return hazelcastInstances[0];
}

代码示例来源:origin: hazelcast/hazelcast-code-samples

private Config getConfigClusterB() {
  Config config = new Config();
  config.setLicenseKey(ENTERPRISE_LICENSE_KEY);
  config.getGroupConfig().setName("clusterB").setPassword("clusterB-pass");
  config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
  config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true).addMember("127.0.0.1:5702");
  config.setInstanceName("clusterB");
  config.getNetworkConfig().setPort(5702);
  config.setClassLoader(createCacheManagerClassLoader());
  return config;
}

相关文章

Config类方法