Search in sources :

Example 31 with MapServiceContext

use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.

the class AbstractMapAllPartitionsMessageTask method getOperationProvider.

protected final MapOperationProvider getOperationProvider(String mapName) {
    MapService mapService = getService(SERVICE_NAME);
    MapServiceContext mapServiceContext = mapService.getMapServiceContext();
    return mapServiceContext.getMapOperationProvider(mapName);
}
Also used : MapService(com.hazelcast.map.impl.MapService) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

Example 32 with MapServiceContext

use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.

the class MapAddInterceptorMessageTask method createOperationSupplier.

@Override
protected Supplier<Operation> createOperationSupplier() {
    final MapService mapService = getService(MapService.SERVICE_NAME);
    final MapServiceContext mapServiceContext = mapService.getMapServiceContext();
    final MapInterceptor mapInterceptor = serializationService.toObject(parameters.interceptor);
    id = mapServiceContext.generateInterceptorId(parameters.name, mapInterceptor);
    return new AddInterceptorOperationSupplier(id, parameters.name, mapInterceptor);
}
Also used : AddInterceptorOperationSupplier(com.hazelcast.client.impl.AddInterceptorOperationSupplier) MapInterceptor(com.hazelcast.map.MapInterceptor) MapService(com.hazelcast.map.impl.MapService) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

Example 33 with MapServiceContext

use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.

the class MapAddListenerMessageTask method registerListener.

private String registerListener(ClientEndpoint endpoint, ListenerAdapter adapter) {
    MapService mapService = getService(MapService.SERVICE_NAME);
    MapServiceContext mapServiceContext = mapService.getMapServiceContext();
    String registrationId;
    if (parameters.localOnly) {
        registrationId = mapServiceContext.addLocalListenerAdapter(adapter, parameters.listenerName);
    } else {
        registrationId = mapServiceContext.addListenerAdapter(adapter, TrueEventFilter.INSTANCE, parameters.listenerName);
    }
    endpoint.addListenerDestroyAction(MapService.SERVICE_NAME, parameters.listenerName, registrationId);
    return registrationId;
}
Also used : MapService(com.hazelcast.map.impl.MapService) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

Example 34 with MapServiceContext

use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.

the class NodeQueryCacheEventService method getRegistrations.

private Collection<EventRegistration> getRegistrations(String mapName) {
    MapServiceContext mapServiceContext = this.mapServiceContext;
    NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
    EventService eventService = nodeEngine.getEventService();
    return eventService.getRegistrations(MapService.SERVICE_NAME, mapName);
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) QueryCacheEventService(com.hazelcast.map.impl.querycache.QueryCacheEventService) EventService(com.hazelcast.spi.EventService) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

Example 35 with MapServiceContext

use of com.hazelcast.map.impl.MapServiceContext in project hazelcast by hazelcast.

the class MapClearMessageTask method reduce.

@Override
protected Object reduce(Map<Integer, Object> map) {
    int clearedTotal = 0;
    for (Object affectedEntries : map.values()) {
        clearedTotal += (Integer) affectedEntries;
    }
    MapService service = getService(MapService.SERVICE_NAME);
    MapServiceContext mapServiceContext = service.getMapServiceContext();
    if (clearedTotal > 0) {
        Address thisAddress = nodeEngine.getThisAddress();
        MapEventPublisher mapEventPublisher = mapServiceContext.getMapEventPublisher();
        mapEventPublisher.publishMapEvent(thisAddress, parameters.name, CLEAR_ALL, clearedTotal);
    }
    return null;
}
Also used : Address(com.hazelcast.nio.Address) MapService(com.hazelcast.map.impl.MapService) MapServiceContext(com.hazelcast.map.impl.MapServiceContext) MapEventPublisher(com.hazelcast.map.impl.event.MapEventPublisher)

Aggregations

MapServiceContext (com.hazelcast.map.impl.MapServiceContext)63 MapService (com.hazelcast.map.impl.MapService)44 MapNearCacheManager (com.hazelcast.map.impl.nearcache.MapNearCacheManager)15 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)14 Invalidator (com.hazelcast.internal.nearcache.impl.invalidation.Invalidator)12 RecordStore (com.hazelcast.map.impl.recordstore.RecordStore)12 MetaDataGenerator (com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator)10 NodeEngine (com.hazelcast.spi.NodeEngine)10 MapProxyImpl (com.hazelcast.map.impl.proxy.MapProxyImpl)7 HazelcastInstance (com.hazelcast.core.HazelcastInstance)6 MapContainer (com.hazelcast.map.impl.MapContainer)6 Data (com.hazelcast.nio.serialization.Data)6 PartitionContainer (com.hazelcast.map.impl.PartitionContainer)5 MapStoreConfig (com.hazelcast.config.MapStoreConfig)4 SimpleEntryView (com.hazelcast.map.impl.SimpleEntryView)4 HashMap (java.util.HashMap)4 Config (com.hazelcast.config.Config)3 MapConfig (com.hazelcast.config.MapConfig)3 NearCacheConfig (com.hazelcast.config.NearCacheConfig)3 Node (com.hazelcast.instance.Node)3