private final ScheduledThreadPoolExecutor observer;
private final ExecutorService executor;
- private volatile Multimap<SchemaPath, ListenerRegistration<? extends DOMNotificationListener>> listeners =
+ private volatile Multimap<SchemaPath, AbstractListenerRegistration<? extends DOMNotificationListener>> listeners =
ImmutableMultimap.of();
@VisibleForTesting
@Override
public synchronized <T extends DOMNotificationListener> ListenerRegistration<T> registerNotificationListener(
final T listener, final Collection<SchemaPath> types) {
- final ListenerRegistration<T> reg = new AbstractListenerRegistration<>(listener) {
+ final AbstractListenerRegistration<T> reg = new AbstractListenerRegistration<>(listener) {
@Override
protected void removeRegistration() {
synchronized (DOMNotificationRouter.this) {
};
if (!types.isEmpty()) {
- final Builder<SchemaPath, ListenerRegistration<? extends DOMNotificationListener>> b =
+ final Builder<SchemaPath, AbstractListenerRegistration<? extends DOMNotificationListener>> b =
ImmutableMultimap.builder();
b.putAll(listeners);
* @param newListeners is used to notify listenerTypes changed
*/
private void replaceListeners(
- final Multimap<SchemaPath, ListenerRegistration<? extends DOMNotificationListener>> newListeners) {
+ final Multimap<SchemaPath, AbstractListenerRegistration<? extends DOMNotificationListener>> newListeners) {
listeners = newListeners;
notifyListenerTypesChanged(newListeners.keySet());
}
}
private ListenableFuture<Void> publish(final long seq, final DOMNotification notification,
- final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers) {
+ final Collection<AbstractListenerRegistration<? extends DOMNotificationListener>> subscribers) {
final DOMNotificationRouterEvent event = disruptor.get(seq);
final ListenableFuture<Void> future = event.initialize(notification, subscribers);
disruptor.getRingBuffer().publish(seq);
@Override
public ListenableFuture<? extends Object> putNotification(final DOMNotification notification)
throws InterruptedException {
- final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers =
+ final Collection<AbstractListenerRegistration<? extends DOMNotificationListener>> subscribers =
listeners.get(notification.getType());
if (subscribers.isEmpty()) {
return NO_LISTENERS;
@SuppressWarnings("checkstyle:IllegalCatch")
@VisibleForTesting
ListenableFuture<? extends Object> tryPublish(final DOMNotification notification,
- final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers) {
+ final Collection<AbstractListenerRegistration<? extends DOMNotificationListener>> subscribers) {
final long seq;
try {
seq = disruptor.getRingBuffer().tryNext();
@Override
public ListenableFuture<? extends Object> offerNotification(final DOMNotification notification) {
- final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers =
+ final Collection<AbstractListenerRegistration<? extends DOMNotificationListener>> subscribers =
listeners.get(notification.getType());
if (subscribers.isEmpty()) {
return NO_LISTENERS;
@Override
public ListenableFuture<? extends Object> offerNotification(final DOMNotification notification, final long timeout,
final TimeUnit unit) throws InterruptedException {
- final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers =
+ final Collection<AbstractListenerRegistration<? extends DOMNotificationListener>> subscribers =
listeners.get(notification.getType());
if (subscribers.isEmpty()) {
return NO_LISTENERS;