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 #equals(Object) and #hashCode() method.

Since:
2.0

Method Summary
 java.util.Set<java.lang.Class<?>> getSupportedEventTypes()
          The types of events supported by this invoker.
 void invoke(java.lang.Object event)
          Invokes the underlying listener for the given event.
 boolean supportAsynchronousEvents()
          Whether or not the underlying listener can handle asynchronous event.
 

Method Detail

getSupportedEventTypes

java.util.Set<java.lang.Class<?>> 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

void invoke(java.lang.Object event)
Invokes the underlying listener for the given event.

Parameters:
event - the event to tell the listener about.
Throws:
java.lang.IllegalArgumentException - if the event is not an instance of any of the types returned by getSupportedEventTypes()

supportAsynchronousEvents

boolean supportAsynchronousEvents()
Whether or not the underlying listener can handle asynchronous event.

Returns:
true if the underlying listener can handle asynchronous events, false otherwise


Copyright © 2006-2011 Atlassian. All Rights Reserved.