Giriş
Şu satırı dahil ederiz
import com.hazelcast.map.impl.MapService;
Sınıfın içi şöyle
public class MapService implements ManagedService, ChunkedMigrationAwareService,
TransactionalService, RemoteService,
EventPublishingService<Object, ListenerAdapter>,
PostJoinAwareService, SplitBrainHandlerService,
WanSupportingService, StatisticsAwareService<LocalMapStats>,
PartitionAwareService, ClientAwareService,
SplitBrainProtectionAwareService, NotifiableEventListener,
ClusterStateListener, LockInterceptorService<Data>,
DynamicMetricsProvider, TenantContextAwareService,
OffloadedReplicationPreparation {
public static final String SERVICE_NAME = "hz:impl:mapService";
protected ManagedService managedService;
protected CountingMigrationAwareService migrationAwareService;
protected TransactionalService transactionalService;
protected RemoteService remoteService;
protected EventPublishingService eventPublishingService;
protected PostJoinAwareService postJoinAwareService;
protected SplitBrainHandlerService splitBrainHandlerService;
protected WanSupportingService wanSupportingService;
protected StatisticsAwareService statisticsAwareService;
protected PartitionAwareService partitionAwareService;
protected ClientAwareService clientAwareService;
protected MapSplitBrainProtectionAwareService splitBrainProtectionAwareService;
protected MapServiceContext mapServiceContext;
...
}Örnek
Şöyle yaparız
MapService mapService = nodeEngine.getService(MapService.SERVICE_NAME); return mapService.getMapServiceContext().getMapContainers().get(name);
Hiç yorum yok:
Yorum Gönder