Package com.atlassian.event.spi
Interface ListenerInvoker
public interface ListenerInvoker
Implementation of this interface know how to invoke 'given types' of listeners so that they handle given events.
Note: Implementations MUST provide correct implementations of the
Object.equals(Object) and Object.hashCode() method.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault intgetOrder()SeeEventPublisher.publish(Object)for details on processing event order.getScope()The types of events supported by this invoker.voidInvokes the underlying listener for the given event.booleanWhether or not the underlying listener can handle asynchronous event.
-
Method Details
-
getSupportedEventTypes
The types of events supported by this invoker. I.e.invoke(Object)can be safely called with any object that is an instance of at least one of those types.- Returns:
- the set of supported event types.
-
invoke
Invokes the underlying listener for the given event.- Parameters:
event- the event to tell the listener about.- Throws:
IllegalArgumentException- if the event is not an instance of any of the types returned bygetSupportedEventTypes()
-
supportAsynchronousEvents
boolean supportAsynchronousEvents()Whether or not the underlying listener can handle asynchronous event.- Returns:
trueif the underlying listener can handle asynchronous events,falseotherwise
-
getScope
-
getOrder
default int getOrder()SeeEventPublisher.publish(Object)for details on processing event order.- Returns:
- int used for ordering event listeners
-