Interface MultipartEventBus
public interface MultipartEventBus
MultipartContainer's.- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classMultipartEventBus.ContextlessListener<E extends MultipartEvent & ContextlessEvent>static classMultipartEventBus.ExternalListener<E extends MultipartEvent>static interfaceMultipartEventBus.ListenerInfo<E extends MultipartEvent>Information on a single registered listener.
- 
Method SummaryModifier and Type Method Description default <E extends MultipartEvent & ContextlessEvent>
 MultipartEventBus.ListenerInfo<E>addContextlessListener(Object key, Class<E> clazz, Runnable listener)Adds a listener for a specifiedMultipartEventthat also implementsContextlessEventwith aRunnable.default <E extends MultipartEvent>
 MultipartEventBus.ListenerInfo<E>addExternalListener(Object key, Class<E> clazz, MultipartEventExternalListener<E> listener)Adds a listener for a specifiedMultipartEvent(and all of it's subclasses), but also passes theMultipartContainerthat the event was fired from ito the event handler.<E extends MultipartEvent>
 MultipartEventBus.ListenerInfo<E>addListener(Object key, Class<E> clazz, EventListener<E> listener)Adds a listener for a specifiedMultipartEvent(and all of it's subclasses).default <E extends MultipartEvent & ContextlessEvent>
 MultipartEventBus.ListenerInfo<E>addRunOnceListener(Object key, Class<E> clazz, Runnable listener)Adds a listener for a specifiedMultipartEventthat also implementsContextlessEventwith aRunnable.booleanfireEvent(MultipartEvent event)Fires the given event to all currently registered listeners.List<? extends MultipartEventBus.ListenerInfo<?>>getAllListeners()MultipartContainergetContainer()<E extends MultipartEvent>
 List<? extends MultipartEventBus.ListenerInfo<? extends E>>getListeners(Class<E> clazz)List<MultipartEventBus.ListenerInfo<? extends MultipartEvent>>getListenersForKey(Object key)default booleanhasAnyListeners()default booleanhasAnyListenersFor(Class<? extends MultipartEvent> clazz)default booleanhasAnyListenersForKey(Object key)voidremoveListeners(Object key)Removes all listeners that were added for the given key.
- 
Method Details- 
getContainerMultipartContainer getContainer()- Returns:
- The MultipartContainerfor thisMultipartEventBus.
 
- 
addListener<E extends MultipartEvent> MultipartEventBus.ListenerInfo<E> addListener(Object key, Class<E> clazz, EventListener<E> listener)Adds a listener for a specifiedMultipartEvent(and all of it's subclasses).This makes only one guarantee for event listener ordering: all listeners added for the same key will be called in the order that they are registered. - Parameters:
- key- The identifier for the listener, compared with identity equality (==) and not object equality. Multiple listeners can be added with the same key. If the caller is an- AbstractPart, and contained within this event bus's- getContainer()then it is strongly recommended that the- AbstractPartis re-used, because when that part is removed from the- MultipartContainer- removeListeners(Object)will be called with that part.
- clazz- The type of event to listen to.
- Throws:
- NullPointerException- if any of the arguments are null.
 
- 
addContextlessListenerdefault <E extends MultipartEvent & ContextlessEvent> MultipartEventBus.ListenerInfo<E> addContextlessListener(Object key, Class<E> clazz, Runnable listener)Adds a listener for a specifiedMultipartEventthat also implementsContextlessEventwith aRunnable.This makes only one guarantee for event listener ordering: all listeners added for the same key will be called in the order that they are registered. - Parameters:
- key- The identifier for the listener, compared with identity equality (==) and not object equality. Multiple listeners can be added with the same key. If the caller is an- AbstractPart, and contained within this event bus's- getContainer()then it is strongly recommended that the- AbstractPartis re-used, because when that part is removed from the- MultipartContainer- removeListeners(Object)will be called with that part.
- clazz- The type of event to listen to.
- Throws:
- NullPointerException- if any of the arguments are null.
 
- 
addRunOnceListenerdefault <E extends MultipartEvent & ContextlessEvent> MultipartEventBus.ListenerInfo<E> addRunOnceListener(Object key, Class<E> clazz, Runnable listener)Adds a listener for a specifiedMultipartEventthat also implementsContextlessEventwith aRunnable.This makes only one guarantee for event listener ordering: all listeners added for the same key will be called in the order that they are registered. After the event has been fired once the listener will be removed, which means that the given listener will only be called once (at most). - Parameters:
- key- The identifier for the listener, compared with identity equality (==) and not object equality. Multiple listeners can be added with the same key. If the caller is an- AbstractPart, and contained within this event bus's- getContainer()then it is strongly recommended that the- AbstractPartis re-used, because when that part is removed from the- MultipartContainer- removeListeners(Object)will be called with that part.
- clazz- The type of event to listen to.
- Throws:
- NullPointerException- if any of the arguments are null.
 
- 
addExternalListenerdefault <E extends MultipartEvent> MultipartEventBus.ListenerInfo<E> addExternalListener(Object key, Class<E> clazz, MultipartEventExternalListener<E> listener)Adds a listener for a specifiedMultipartEvent(and all of it's subclasses), but also passes theMultipartContainerthat the event was fired from ito the event handler.This makes only one guarantee for event listener ordering: all listeners added for the same key will be called in the order that they are registered. - Parameters:
- key- The identifier for the listener, compared with identity equality (==) and not object equality. Multiple listeners can be added with the same key. If the caller is an- AbstractPart, and contained within this event bus's- getContainer()then it is strongly recommended that the- AbstractPartis re-used, because when that part is removed from the- MultipartContainer- removeListeners(Object)will be called with that part.
- clazz- The type of event to listen to.
- Throws:
- NullPointerException- if any of the arguments are null.
 
- 
fireEventFires the given event to all currently registered listeners.- Returns:
- True if any listeners received the given event, false if none did. This may be useful for optimisation purposes.
 
- 
removeListenersRemoves all listeners that were added for the given key.
- 
getListenersForKey- Parameters:
- key- The identifier that was used in- addListener(Object, Class, EventListener).
- Returns:
- All listeners that were registered for the given key.
 
- 
hasAnyListenersForKey
- 
getListeners<E extends MultipartEvent> List<? extends MultipartEventBus.ListenerInfo<? extends E>> getListeners(Class<E> clazz)- Returns:
- A list of every MultipartEventBus.ListenerInfothat will receive events of the given type.
 
- 
getAllListenersList<? extends MultipartEventBus.ListenerInfo<?>> getAllListeners()- Returns:
- A list of every MultipartEventBus.ListenerInfocurrent registered to this event bus.
 
- 
hasAnyListenersFor
- 
hasAnyListenersdefault boolean hasAnyListeners()
 
-