use of com.hazelcast.test.compatibility.SamplingNodeExtension in project hazelcast by hazelcast.
the class MockNodeContext method constructSamplingNodeExtension.
/**
* @return {@code NodeExtension} suitable for sampling serialized objects in OSS or EE environment
*/
@SuppressWarnings("unchecked")
private static NodeExtension constructSamplingNodeExtension(Node node) {
if (BuildInfoProvider.getBuildInfo().isEnterprise()) {
try {
Class<? extends NodeExtension> klass = (Class<? extends NodeExtension>) Class.forName("com.hazelcast.test.compatibility.SamplingEnterpriseNodeExtension");
Constructor<? extends NodeExtension> constructor = klass.getConstructor(Node.class);
return constructor.newInstance(node);
} catch (Exception e) {
throw rethrow(e);
}
} else {
NodeExtension wrapped = NodeExtensionFactory.create(node, DefaultNodeContext.EXTENSION_PRIORITY_LIST);
return new SamplingNodeExtension(wrapped);
}
}
Aggregations