use of com.hazelcast.instance.impl.NodeExtension in project hazelcast by hazelcast.
the class ClientAuthenticationTest method testAuthentication_with_mcModeEnabled_when_clusterStart_isNotComplete.
@Test
public void testAuthentication_with_mcModeEnabled_when_clusterStart_isNotComplete() {
HazelcastInstanceFactory.newHazelcastInstance(new Config(), randomName(), new MockNodeContext(hazelcastFactory.getRegistry(), hazelcastFactory.nextAddress()) {
@Override
public NodeExtension createNodeExtension(Node node) {
return new DefaultNodeExtension(node) {
@Override
public boolean isStartCompleted() {
return false;
}
};
}
});
ClientConfig clientConfig = new ClientConfig();
clientConfig.setProperty(MC_CLIENT_MODE_PROP.getName(), "true");
// if the client is able to connect, it's a pass
hazelcastFactory.newHazelcastClient(clientConfig);
}
use of com.hazelcast.instance.impl.NodeExtension in project hazelcast by hazelcast.
the class InterceptorRegistryTest method getPartitionOperationThread.
private PartitionOperationThread getPartitionOperationThread(OperationQueue queue) {
NodeExtension nodeExtension = mock(NodeExtension.class);
OperationRunner operationRunner = mock(OperationRunner.class);
OperationRunner[] operationRunners = new OperationRunner[] { operationRunner };
return new PartitionOperationThread("threadName", 0, queue, LOGGER, nodeExtension, operationRunners, getClass().getClassLoader());
}
use of com.hazelcast.instance.impl.NodeExtension 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);
}
}
use of com.hazelcast.instance.impl.NodeExtension in project hazelcast by hazelcast.
the class HazelcastTestSupport method assertNodeStarted.
public static void assertNodeStarted(HazelcastInstance instance) {
NodeExtension nodeExtension = Accessors.getNode(instance).getNodeExtension();
assertTrue(nodeExtension.isStartCompleted());
}
use of com.hazelcast.instance.impl.NodeExtension in project hazelcast by hazelcast.
the class ServiceManagerImpl method registerExtensionServices.
private void registerExtensionServices() {
logger.finest("Registering extension services...");
NodeExtension nodeExtension = nodeEngine.getNode().getNodeExtension();
Map<String, Object> services = nodeExtension.createExtensionServices();
for (Map.Entry<String, Object> entry : services.entrySet()) {
registerService(entry.getKey(), entry.getValue());
}
}
Aggregations