use of com.hazelcast.concurrent.semaphore.SemaphoreService in project hazelcast by hazelcast.
the class SemaphoreDetachMemberOperation method run.
@Override
public void run() throws Exception {
SemaphoreService service = getService();
if (service.containsSemaphore(name)) {
SemaphoreContainer semaphoreContainer = service.getSemaphoreContainer(name);
response = semaphoreContainer.detachAll(detachedMemberUuid);
}
ILogger logger = getLogger();
if (logger.isFineEnabled()) {
logger.fine("Removing permits attached to " + detachedMemberUuid + ". Result: " + response);
}
}
use of com.hazelcast.concurrent.semaphore.SemaphoreService in project hazelcast by hazelcast.
the class ServiceManagerImpl method registerDefaultServices.
private void registerDefaultServices(ServicesConfig servicesConfig) {
if (!servicesConfig.isEnableDefaults()) {
return;
}
logger.finest("Registering default services...");
registerService(MapService.SERVICE_NAME, createService(MapService.class));
registerService(LockService.SERVICE_NAME, new LockServiceImpl(nodeEngine));
registerService(QueueService.SERVICE_NAME, new QueueService(nodeEngine));
registerService(TopicService.SERVICE_NAME, new TopicService());
registerService(ReliableTopicService.SERVICE_NAME, new ReliableTopicService(nodeEngine));
registerService(MultiMapService.SERVICE_NAME, new MultiMapService(nodeEngine));
registerService(ListService.SERVICE_NAME, new ListService(nodeEngine));
registerService(SetService.SERVICE_NAME, new SetService(nodeEngine));
registerService(DistributedExecutorService.SERVICE_NAME, new DistributedExecutorService());
registerService(DistributedDurableExecutorService.SERVICE_NAME, new DistributedDurableExecutorService(nodeEngine));
registerService(AtomicLongService.SERVICE_NAME, new AtomicLongService());
registerService(AtomicReferenceService.SERVICE_NAME, new AtomicReferenceService());
registerService(CountDownLatchService.SERVICE_NAME, new CountDownLatchService());
registerService(SemaphoreService.SERVICE_NAME, new SemaphoreService(nodeEngine));
registerService(IdGeneratorService.SERVICE_NAME, new IdGeneratorService(nodeEngine));
registerService(MapReduceService.SERVICE_NAME, new MapReduceService(nodeEngine));
registerService(ReplicatedMapService.SERVICE_NAME, new ReplicatedMapService(nodeEngine));
registerService(RingbufferService.SERVICE_NAME, new RingbufferService(nodeEngine));
registerService(XAService.SERVICE_NAME, new XAService(nodeEngine));
registerService(CardinalityEstimatorService.SERVICE_NAME, new CardinalityEstimatorService());
registerService(DistributedScheduledExecutorService.SERVICE_NAME, new DistributedScheduledExecutorService());
registerCacheServiceIfAvailable();
readServiceDescriptors();
}
use of com.hazelcast.concurrent.semaphore.SemaphoreService in project hazelcast by hazelcast.
the class PartitionControlledIdTest method testSemaphore.
@Test
public void testSemaphore() throws Exception {
String partitionKey = "hazelcast";
HazelcastInstance hz = getHazelcastInstance(partitionKey);
ISemaphore semaphore = hz.getSemaphore("semaphore@" + partitionKey);
semaphore.release();
assertEquals("semaphore@" + partitionKey, semaphore.getName());
assertEquals(partitionKey, semaphore.getPartitionKey());
SemaphoreService service = getNodeEngine(hz).getService(SemaphoreService.SERVICE_NAME);
assertTrue(service.containsSemaphore(semaphore.getName()));
}
use of com.hazelcast.concurrent.semaphore.SemaphoreService in project hazelcast by hazelcast.
the class SemaphoreReplicationOperation method run.
@Override
public void run() throws Exception {
SemaphoreService service = getService();
for (SemaphoreContainer semaphoreContainer : migrationData.values()) {
semaphoreContainer.setInitialized();
}
service.insertMigrationData(migrationData);
}
use of com.hazelcast.concurrent.semaphore.SemaphoreService in project hazelcast by hazelcast.
the class SemaphoreDetachMemberBackupOperation method run.
@Override
public void run() throws Exception {
SemaphoreService service = getService();
if (service.containsSemaphore(name)) {
SemaphoreContainer semaphoreContainer = service.getSemaphoreContainer(name);
response = semaphoreContainer.detachAll(firstCaller);
}
}
Aggregations