use of com.hazelcast.config.ClasspathXmlConfig in project hazelcast by hazelcast.
the class CachingProviderTest method setup.
@Before
public void setup() {
instance1 = createHazelcastInstance(INSTANCE_1_NAME);
instance2 = createHazelcastInstance(INSTANCE_2_NAME);
cachingProvider = createCachingProvider(instance1);
// also start a hazelcast instance off a well-known config location
Config config = new ClasspathXmlConfig(CONFIG_CLASSPATH_LOCATION);
instance3 = instanceFactory.newHazelcastInstance(config);
}
use of com.hazelcast.config.ClasspathXmlConfig in project hazelcast by hazelcast.
the class PartitionStateGeneratorTest method testXmlPartitionGroupConfig.
@Test
public void testXmlPartitionGroupConfig() {
Config config = new ClasspathXmlConfig("hazelcast-fullconfig.xml");
PartitionGroupConfig partitionGroupConfig = config.getPartitionGroupConfig();
assertTrue(partitionGroupConfig.isEnabled());
assertEquals(PartitionGroupConfig.MemberGroupType.CUSTOM, partitionGroupConfig.getGroupType());
assertEquals(2, partitionGroupConfig.getMemberGroupConfigs().size());
}
use of com.hazelcast.config.ClasspathXmlConfig in project SSM by Intel-bigdata.
the class HazelcastInstanceProvider method getInstance.
public static HazelcastInstance getInstance() {
if (instance == null) {
ClasspathXmlConfig config = new ClasspathXmlConfig(CONFIG_FILE);
addMemberConfig(config);
instance = Hazelcast.newHazelcastInstance(config);
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
instance.getLifecycleService().shutdown();
}
});
}
return instance;
}
use of com.hazelcast.config.ClasspathXmlConfig in project jain-sip.ha by RestComm.
the class HazelcastCache method init.
public void init() throws SipCacheException {
Config cfg = null;
String instanceName = configProperties.getProperty(HAZELCAST_INSTANCE_NAME, DEFAULT_HAZELCAST_INSTANCE_NAME);
hz = Hazelcast.getHazelcastInstanceByName(instanceName);
if (hz == null) {
String pojoConfigurationPath = configProperties.getProperty(HAZELCAST_CACHE_CONFIG_PATH);
if (pojoConfigurationPath != null) {
if (clusteredlogger.isLoggingEnabled(StackLogger.TRACE_INFO)) {
clusteredlogger.logInfo("Mobicents JAIN SIP Hazelcast Cache Configuration path is : " + pojoConfigurationPath);
}
try {
cfg = new XmlConfigBuilder(pojoConfigurationPath).build();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
} else {
cfg = new ClasspathXmlConfig(DEFAULT_FILE_CONFIG_PATH);
}
cfg.setInstanceName(instanceName);
hz = Hazelcast.newHazelcastInstance(cfg);
}
dialogs = hz.getMap("cache.dialogs");
appDataMap = hz.getMap("cache.appdata");
serverTransactions = hz.getMap("cache.serverTX");
serverTransactionsApp = hz.getMap("cache.serverTXApp");
clientTransactions = hz.getMap("cache.clientTX");
clientTransactionsApp = hz.getMap("cache.clientTXApp");
}
Aggregations