use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class MapProxySupport method addMapInterceptorInternal.
public String addMapInterceptorInternal(MapInterceptor interceptor) {
NodeEngine nodeEngine = getNodeEngine();
if (interceptor instanceof HazelcastInstanceAware) {
((HazelcastInstanceAware) interceptor).setHazelcastInstance(nodeEngine.getHazelcastInstance());
}
String id = mapServiceContext.generateInterceptorId(name, interceptor);
Collection<Member> members = nodeEngine.getClusterService().getMembers();
for (Member member : members) {
try {
AddInterceptorOperation op = new AddInterceptorOperation(id, interceptor, name);
Future future = operationService.invokeOnTarget(SERVICE_NAME, op, member.getAddress());
future.get();
} catch (Throwable t) {
throw rethrow(t);
}
}
return id;
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class NodeQueryCacheEventService method canPassFilter.
private boolean canPassFilter(LocalEntryEventData localEntryEventData, EventFilter filter) {
if (filter == null || filter instanceof TrueEventFilter) {
return true;
}
NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
SerializationService serializationService = nodeEngine.getSerializationService();
Data keyData = localEntryEventData.getKeyData();
Object value = getValueOrOldValue(localEntryEventData);
QueryableEntry entry = new QueryEntry((InternalSerializationService) serializationService, keyData, value, Extractors.empty());
return filter.eval(entry);
}
use of com.hazelcast.spi.NodeEngine 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);
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class NodeQueryCacheEventService method removeListener.
@Override
public boolean removeListener(String mapName, String cacheName, String id) {
String listenerName = generateListenerName(mapName, cacheName);
NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
EventService eventService = nodeEngine.getEventService();
return eventService.deregisterListener(MapService.SERVICE_NAME, listenerName, id);
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class ExecutorServiceProxy method submitToAllMembers.
@Override
public <T> void submitToAllMembers(Callable<T> task, MultiExecutionCallback callback) {
NodeEngine nodeEngine = getNodeEngine();
submitToMembers(task, nodeEngine.getClusterService().getMembers(), callback);
}
Aggregations