Package org.infinispan.notifications
Interface Listenable
-
- All Known Subinterfaces:
AdvancedCache<K,V>,Cache<K,V>,CacheManagerNotifier,CacheNotifier<K,V>,ClassLoaderAwareFilteringListenable<K,V>,ClassLoaderAwareListenable,ClusterCacheNotifier<K,V>,DataConversionAwareListenable<K,V>,EmbeddedCacheManager,FilteringListenable<K,V>,SecureCache<K,V>
- All Known Implementing Classes:
AbstractDelegatingAdvancedCache,org.infinispan.cache.impl.AbstractDelegatingAdvancedCache,AbstractDelegatingCache,org.infinispan.cache.impl.AbstractDelegatingCache,AbstractDelegatingEmbeddedCacheManager,org.infinispan.manager.impl.AbstractDelegatingEmbeddedCacheManager,CacheManagerNotifierImpl,CacheNotifierImpl,DefaultCacheManager
public interface ListenableInterface that denotes that the implementation can have listeners attached to it.- Since:
- 4.0
- Author:
- Manik Surtani
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddListener(java.lang.Object listener)Adds a listener to the component.java.util.Set<java.lang.Object>getListeners()voidremoveListener(java.lang.Object listener)Removes a listener from the component.
-
-
-
Method Detail
-
addListener
void addListener(java.lang.Object listener)
Adds a listener to the component. Typically, listeners would need to be annotated withListenerand further to that, contain methods annotated appropriately, otherwise the listener will not be registered. See theListenerannotation for more information.- Parameters:
listener- must not be null.
-
removeListener
void removeListener(java.lang.Object listener)
Removes a listener from the component.- Parameters:
listener- listener to remove. Must not be null.- Throws:
IllegalLifecycleStateException- may be thrown if theListenableis stopped.
-
getListeners
java.util.Set<java.lang.Object> getListeners()
- Returns:
- a set of all listeners registered on this component.
-
-