use of org.infinispan.notifications.cachelistener.cluster.RemoteClusterListener in project infinispan by infinispan.
the class CacheNotifierImpl method registerClusterListenerCallablesToInstall.
private void registerClusterListenerCallablesToInstall(Set<Object> enlistedAlready, Set<ClusterListenerReplicateCallable<K, V>> callables, List<CacheEntryListenerInvocation<K, V>> listenerInvocations) {
for (CacheEntryListenerInvocation<K, V> listener : listenerInvocations) {
if (!enlistedAlready.contains(listener.getTarget())) {
// If clustered means it is local - so use our address
if (listener.isClustered()) {
Set<Class<? extends Annotation>> filterAnnotations = listener.getFilterAnnotations();
callables.add(new ClusterListenerReplicateCallable(cache.wired().getName(), listener.getIdentifier(), rpcManager.getAddress(), listener.getFilter(), listener.getConverter(), listener.isSync(), filterAnnotations, listener.getKeyDataConversion(), listener.getValueDataConversion(), listener.useStorageFormat()));
enlistedAlready.add(listener.getTarget());
} else if (listener.getTarget() instanceof RemoteClusterListener) {
RemoteClusterListener lcl = (RemoteClusterListener) listener.getTarget();
Set<Class<? extends Annotation>> filterAnnotations = listener.getFilterAnnotations();
callables.add(new ClusterListenerReplicateCallable(cache.wired().getName(), lcl.getId(), lcl.getOwnerAddress(), listener.getFilter(), listener.getConverter(), listener.isSync(), filterAnnotations, listener.getKeyDataConversion(), listener.getValueDataConversion(), listener.useStorageFormat()));
enlistedAlready.add(listener.getTarget());
}
}
}
}
Aggregations