Search in sources :

Example 1 with QueueEventFilter

use of com.hazelcast.collection.impl.queue.QueueEventFilter in project hazelcast by hazelcast.

the class QueueOperation method publishEvent.

public void publishEvent(ItemEventType eventType, Data data) {
    EventService eventService = getNodeEngine().getEventService();
    Collection<EventRegistration> registrations = eventService.getRegistrations(getServiceName(), name);
    Address thisAddress = getNodeEngine().getThisAddress();
    for (EventRegistration registration : registrations) {
        QueueEventFilter filter = (QueueEventFilter) registration.getFilter();
        QueueEvent event = new QueueEvent(name, filter.isIncludeValue() ? data : null, eventType, thisAddress);
        eventService.publishEvent(getServiceName(), registration, event, name.hashCode());
    }
}
Also used : EventRegistration(com.hazelcast.spi.EventRegistration) Address(com.hazelcast.nio.Address) QueueEventFilter(com.hazelcast.collection.impl.queue.QueueEventFilter) QueueEvent(com.hazelcast.collection.impl.queue.QueueEvent) EventService(com.hazelcast.spi.EventService)

Aggregations

QueueEvent (com.hazelcast.collection.impl.queue.QueueEvent)1 QueueEventFilter (com.hazelcast.collection.impl.queue.QueueEventFilter)1 Address (com.hazelcast.nio.Address)1 EventRegistration (com.hazelcast.spi.EventRegistration)1 EventService (com.hazelcast.spi.EventService)1