use of com.hazelcast.spi.QuorumAwareService in project hazelcast by hazelcast.
the class AbstractMapServiceFactory method createMapService.
/**
* Returns a {@link MapService} object by populating it with required
* auxiliary services.
*
* @return {@link MapService} object
*/
@Override
public MapService createMapService() {
MapServiceContext mapServiceContext = getMapServiceContext();
ManagedService managedService = createManagedService();
CountingMigrationAwareService migrationAwareService = createMigrationAwareService();
TransactionalService transactionalService = createTransactionalService();
RemoteService remoteService = createRemoteService();
EventPublishingService eventPublishingService = createEventPublishingService();
PostJoinAwareService postJoinAwareService = createPostJoinAwareService();
SplitBrainHandlerService splitBrainHandlerService = createSplitBrainHandlerService();
ReplicationSupportingService replicationSupportingService = createReplicationSupportingService();
StatisticsAwareService statisticsAwareService = createStatisticsAwareService();
PartitionAwareService partitionAwareService = createPartitionAwareService();
QuorumAwareService quorumAwareService = createQuorumAwareService();
ClientAwareService clientAwareService = createClientAwareService();
checkNotNull(mapServiceContext, "mapServiceContext should not be null");
checkNotNull(managedService, "managedService should not be null");
checkNotNull(migrationAwareService, "migrationAwareService should not be null");
checkNotNull(transactionalService, "transactionalService should not be null");
checkNotNull(remoteService, "remoteService should not be null");
checkNotNull(eventPublishingService, "eventPublishingService should not be null");
checkNotNull(postJoinAwareService, "postJoinAwareService should not be null");
checkNotNull(splitBrainHandlerService, "splitBrainHandlerService should not be null");
checkNotNull(replicationSupportingService, "replicationSupportingService should not be null");
checkNotNull(statisticsAwareService, "statisticsAwareService should not be null");
checkNotNull(partitionAwareService, "partitionAwareService should not be null");
checkNotNull(quorumAwareService, "quorumAwareService should not be null");
checkNotNull(clientAwareService, "clientAwareService should not be null");
MapService mapService = new MapService();
mapService.managedService = managedService;
mapService.migrationAwareService = migrationAwareService;
mapService.transactionalService = transactionalService;
mapService.remoteService = remoteService;
mapService.eventPublishingService = eventPublishingService;
mapService.postJoinAwareService = postJoinAwareService;
mapService.splitBrainHandlerService = splitBrainHandlerService;
mapService.replicationSupportingService = replicationSupportingService;
mapService.statisticsAwareService = statisticsAwareService;
mapService.mapServiceContext = mapServiceContext;
mapService.partitionAwareService = partitionAwareService;
mapService.quorumAwareService = quorumAwareService;
mapService.clientAwareService = clientAwareService;
mapServiceContext.setService(mapService);
return mapService;
}
use of com.hazelcast.spi.QuorumAwareService in project hazelcast by hazelcast.
the class QuorumServiceImpl method findQuorum.
/**
* Returns a {@link QuorumImpl} for the given operation. The operation should be named and the operation service should
* be a {@link QuorumAwareService}. This service will then return the quorum configured under the name returned by the
* operation service.
*
* @param op the operation for which the Quorum should be returned
* @return the quorum
*/
private QuorumImpl findQuorum(Operation op) {
if (!isNamedOperation(op) || !isQuorumAware(op)) {
return null;
}
QuorumAwareService service = op.getService();
String name = ((NamedOperation) op).getName();
String quorumName = service.getQuorumName(name);
if (quorumName == null) {
return null;
}
return quorums.get(quorumName);
}
Aggregations