Search in sources :

Example 6 with MapServiceContext

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

the class AbstractMapAddEntryListenerMessageTask method call.

@Override
protected Object call() {
    final ClientEndpoint endpoint = getEndpoint();
    final MapService mapService = getService(MapService.SERVICE_NAME);
    Object listener = newMapListener();
    MapServiceContext mapServiceContext = mapService.getMapServiceContext();
    String name = getDistributedObjectName();
    EventFilter eventFilter = getEventFilter();
    String registrationId;
    if (isLocalOnly()) {
        registrationId = mapServiceContext.addLocalEventListener(listener, eventFilter, name);
    } else {
        registrationId = mapServiceContext.addEventListener(listener, eventFilter, name);
    }
    endpoint.addListenerDestroyAction(MapService.SERVICE_NAME, name, registrationId);
    return registrationId;
}
Also used : ClientEndpoint(com.hazelcast.client.ClientEndpoint) MapService(com.hazelcast.map.impl.MapService) EventFilter(com.hazelcast.spi.EventFilter) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

Example 7 with MapServiceContext

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

the class MapFlushMessageTask method call.

@Override
protected Object call() throws Exception {
    MapService mapService = getService(SERVICE_NAME);
    MapServiceContext mapServiceContext = mapService.getMapServiceContext();
    NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
    ProxyService proxyService = nodeEngine.getProxyService();
    DistributedObject distributedObject = proxyService.getDistributedObject(SERVICE_NAME, parameters.name);
    MapProxyImpl mapProxy = (MapProxyImpl) distributedObject;
    mapProxy.flush();
    return null;
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) DistributedObject(com.hazelcast.core.DistributedObject) ProxyService(com.hazelcast.spi.ProxyService) MapProxyImpl(com.hazelcast.map.impl.proxy.MapProxyImpl) MapService(com.hazelcast.map.impl.MapService) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

Example 8 with MapServiceContext

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

the class WriteBehindStore method getInMemoryFormat.

private static InMemoryFormat getInMemoryFormat(MapStoreContext mapStoreContext) {
    MapServiceContext mapServiceContext = mapStoreContext.getMapServiceContext();
    NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
    Config config = nodeEngine.getConfig();
    String mapName = mapStoreContext.getMapName();
    MapConfig mapConfig = config.findMapConfig(mapName);
    return mapConfig.getInMemoryFormat();
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) MapConfig(com.hazelcast.config.MapConfig) Config(com.hazelcast.config.Config) MapStoreConfig(com.hazelcast.config.MapStoreConfig) MapConfig(com.hazelcast.config.MapConfig) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

Example 9 with MapServiceContext

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

the class EntryOperation method getLocalMapStats.

private LocalMapStatsImpl getLocalMapStats() {
    final MapServiceContext mapServiceContext = mapService.getMapServiceContext();
    final LocalMapStatsProvider localMapStatsProvider = mapServiceContext.getLocalMapStatsProvider();
    return localMapStatsProvider.getLocalMapStatsImpl(name);
}
Also used : LocalMapStatsProvider(com.hazelcast.map.impl.LocalMapStatsProvider) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

Example 10 with MapServiceContext

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

the class BasicMapStoreContext method callLifecycleSupportInit.

private static void callLifecycleSupportInit(MapStoreContext mapStoreContext) {
    final MapStoreWrapper mapStoreWrapper = mapStoreContext.getMapStoreWrapper();
    final MapServiceContext mapServiceContext = mapStoreContext.getMapServiceContext();
    final NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
    final HazelcastInstance hazelcastInstance = nodeEngine.getHazelcastInstance();
    final MapStoreConfig mapStoreConfig = mapStoreContext.getMapStoreConfig();
    final Properties properties = mapStoreConfig.getProperties();
    final String mapName = mapStoreContext.getMapName();
    mapStoreWrapper.init(hazelcastInstance, properties, mapName);
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) MapStoreWrapper(com.hazelcast.map.impl.MapStoreWrapper) HazelcastInstance(com.hazelcast.core.HazelcastInstance) MapStoreConfig(com.hazelcast.config.MapStoreConfig) Properties(java.util.Properties) MapServiceContext(com.hazelcast.map.impl.MapServiceContext)

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