use of com.hazelcast.instance.impl.NodeContext in project hazelcast by hazelcast.
the class TestHazelcastInstanceFactory method newHazelcastInstance.
/**
* Creates a new test Hazelcast instance.
*
* @param address the address to use as Member's address instead of picking the next address
* @param config the config to use; use {@code null} to get the default config
*/
public HazelcastInstance newHazelcastInstance(Address address, Config config) {
final String instanceName = config != null ? config.getInstanceName() : null;
if (isMockNetwork) {
config = initOrCreateConfig(config);
NodeContext nodeContext = registry.createNodeContext(address);
HazelcastInstance hazelcastInstance = HazelcastInstanceFactory.newHazelcastInstance(config, instanceName, nodeContext);
registerTestMetricsPublisher(hazelcastInstance);
return hazelcastInstance;
}
throw new UnsupportedOperationException("Explicit address is only available for mock network setup!");
}
Aggregations