use of com.hazelcast.internal.locksupport.LockProxySupport in project hazelcast by hazelcast.
the class LockInterceptorServiceTest method testLockingInterceptor.
private void testLockingInterceptor(LockInterceptingService implementation) {
Config config = new Config();
ConfigAccessor.getServicesConfig(config).addServiceConfig(new ServiceConfig().setEnabled(true).setName(LockInterceptingService.SERVICE_NAME).setImplementation(implementation));
HazelcastInstance member = createHazelcastInstance(config);
NodeEngine nodeEngine = getNodeEngineImpl(member);
implementation.serializationService = getSerializationService(member);
LockProxySupport lockProxySupport = new LockProxySupport(new DistributedObjectNamespace(LockInterceptingService.SERVICE_NAME, "test-object"), 10000);
for (int i = 0; i < 100; i++) {
try {
Data key = getSerializationService(member).toData("key" + i);
lockProxySupport.lock(nodeEngine, key);
} catch (RuntimeException e) {
ignore(e);
}
}
}
Aggregations