Class StandardListenerManager<T>
java.lang.Object
org.apache.curator.framework.listen.StandardListenerManager<T>
- All Implemented Interfaces:
Listenable<T>
,ListenerManager<T,
,T> UnaryListenerManager<T>
Non mapping version of a listener container
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(T listener) Add the given listener.void
addListener
(T listener, Executor executor) Add the given listener.void
clear()
Remove all listenersvoid
Utility - apply the given function to each listener.static <T> StandardListenerManager
<T> mappingStandard
(UnaryOperator<T> mapper) Returns a new mapping container that maps to the same typevoid
removeListener
(T listener) Remove the given listenerint
size()
Return the number of listenersstatic <T> StandardListenerManager
<T> standard()
Returns a new standard listener containerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.curator.framework.listen.ListenerManager
isEmpty
-
Method Details
-
standard
Returns a new standard listener container- Returns:
- new container
-
mappingStandard
Returns a new mapping container that maps to the same type- Parameters:
mapper
- listener mapper/wrapper- Returns:
- new container
-
addListener
Description copied from interface:Listenable
Add the given listener. The listener will be executed in the containing instance's thread.- Specified by:
addListener
in interfaceListenable<T>
- Parameters:
listener
- listener to add
-
addListener
Description copied from interface:Listenable
Add the given listener. The listener will be executed using the given executor- Specified by:
addListener
in interfaceListenable<T>
- Parameters:
listener
- listener to addexecutor
- executor to run listener in
-
removeListener
Description copied from interface:Listenable
Remove the given listener- Specified by:
removeListener
in interfaceListenable<T>
- Parameters:
listener
- listener to remove
-
clear
public void clear()Description copied from interface:ListenerManager
Remove all listeners- Specified by:
clear
in interfaceListenerManager<T,
T>
-
size
public int size()Description copied from interface:ListenerManager
Return the number of listeners- Specified by:
size
in interfaceListenerManager<T,
T> - Returns:
- number
-
forEach
Description copied from interface:ListenerManager
Utility - apply the given function to each listener. The function receives the listener as an argument.- Specified by:
forEach
in interfaceListenerManager<T,
T> - Parameters:
function
- function to call for each listener
-