Package com.hazelcast.spi

Examples of com.hazelcast.spi.EventFilter


                    endpoint.sendEvent(portableEntryEvent, getCallId());
                }
            }
        };

        EventFilter eventFilter;
        if (getPredicate() == null) {
            eventFilter = new EntryEventFilter(includeValue, key);
        } else {
            eventFilter = new QueryEventFilter(includeValue, key, getPredicate());
        }
View Full Code Here


        if (registrations.size() > 0) {
            EntryEvent event = new EntryEvent(name, nodeEngine.getLocalMember(), eventType.getType(),
                    key, oldValue, value);

            for (EventRegistration registration : registrations) {
                EventFilter filter = registration.getFilter();
                boolean publish = filter == null || filter.eval(marshallKey(key));
                if (publish) {
                    eventService.publishEvent(ReplicatedMapService.SERVICE_NAME, registration, event, name.hashCode());
                }
            }
        }
View Full Code Here

        final Set<EventRegistration> registrationsWithValue = new HashSet<EventRegistration>();
        final Set<EventRegistration> registrationsWithoutValue = new HashSet<EventRegistration>();
        // iterate on candidates.
        for (final EventRegistration candidate : candidates) {
            Result result = Result.NONE;
            final EventFilter filter = candidate.getFilter();
            if (emptyFilter(filter)) {
                result = processEmptyFilter();
            } else if (queryEventFilter(filter)) {
                result = processQueryEventFilter(filter, eventType, dataKey, dataOldValue, dataValue);
            } else if (filter.eval(dataKey)) {
                result = processEntryEventFilter(filter);
            }
            registerCandidate(result, candidate, registrationsWithValue, registrationsWithoutValue);
        }
        if (registrationsWithValue.isEmpty() && registrationsWithoutValue.isEmpty()) {
View Full Code Here

    public String addLocalEntryListenerInternal(EntryListener listener, Predicate predicate,
                                                final Data key, boolean includeValue) {

        final MapService mapService = getService();
        EventFilter eventFilter = new QueryEventFilter(includeValue, key, predicate);
        return mapService.getMapServiceContext().addLocalEventListener(listener, eventFilter, name);
    }
View Full Code Here

        return mapService.getMapServiceContext().addLocalEventListener(listener, eventFilter, name);
    }

    protected String addEntryListenerInternal(
            final EntryListener listener, final Data key, final boolean includeValue) {
        EventFilter eventFilter = new EntryEventFilter(includeValue, key);
        final MapService mapService = getService();
        return mapService.getMapServiceContext().addEventListener(listener, eventFilter, name);
    }
View Full Code Here

        return mapService.getMapServiceContext().addEventListener(listener, eventFilter, name);
    }

    protected String addEntryListenerInternal(
            EntryListener listener, Predicate predicate, final Data key, final boolean includeValue) {
        EventFilter eventFilter = new QueryEventFilter(includeValue, key, predicate);
        final MapService mapService = getService();
        return mapService.getMapServiceContext().addEventListener(listener, eventFilter, name);
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.spi.EventFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.