use of com.hazelcast.internal.services.ListenerWrapperEventFilter in project hazelcast by hazelcast.
the class EventServiceSegment method pingNotifiableEventListener.
/**
* Notifies the registration of a event in the listener lifecycle.
* The registration is checked for a {@link NotifiableEventListener} in this order :
* <ul>
* <li>first check if {@link Registration#getListener()} returns a {@link NotifiableEventListener}</li>
* <li>otherwise check if the event filter wraps a listener and use that one</li>
* </ul>
*
* @param topic the event topic
* @param registration the listener registration
* @param register if the listener was registered or not
*/
private void pingNotifiableEventListener(String topic, Registration registration, boolean register) {
Object listener = registration.getListener();
if (!(listener instanceof NotifiableEventListener)) {
EventFilter filter = registration.getFilter();
if (filter instanceof ListenerWrapperEventFilter) {
listener = ((ListenerWrapperEventFilter) filter).getListener();
}
}
pingNotifiableEventListenerInternal(listener, topic, registration, register);
pingNotifiableEventListenerInternal(service, topic, registration, register);
}
Aggregations