use of com.hazelcast.config.FileSystemXmlConfig in project hazelcast by hazelcast.
the class ConsoleApp method main.
/**
* Starts the test application.
*
* Loads the config from classpath hazelcast.xml, if it fails to load, will use default config.
*/
public static void main(String[] args) throws Exception {
Config config;
try {
config = new FileSystemXmlConfig("hazelcast.xml");
} catch (FileNotFoundException e) {
config = new Config();
}
for (int i = 1; i <= LOAD_EXECUTORS_COUNT; i++) {
config.addExecutorConfig(new ExecutorConfig(EXECUTOR_NAMESPACE + " " + i).setPoolSize(i));
}
ConsoleApp consoleApp = new ConsoleApp(Hazelcast.newHazelcastInstance(config));
consoleApp.start();
}
use of com.hazelcast.config.FileSystemXmlConfig in project orientdb by orientechnologies.
the class OHazelcastPlugin method configureHazelcast.
protected HazelcastInstance configureHazelcast() throws FileNotFoundException {
// If hazelcastConfig is null, use the file system XML config.
if (hazelcastConfig == null) {
hazelcastConfig = new FileSystemXmlConfig(hazelcastConfigFile);
hazelcastConfig.setClassLoader(this.getClass().getClassLoader());
}
hazelcastConfig.getMapConfig(CONFIG_REGISTEREDNODES).setBackupCount(6);
hazelcastConfig.getMapConfig(OHazelcastDistributedMap.ORIENTDB_MAP).setMergePolicy(OHazelcastMergeStrategy.class.getName());
return Hazelcast.newHazelcastInstance(hazelcastConfig);
}
Aggregations