public interface EventInvocation
notifyListener(). If the
notification fails because the listener throws an exception, this invocation
will be converted into a FailedEventInvocation and passed to
ExceptionCallback.exception(FailedEventInvocation).| Modifier and Type | Method and Description |
|---|---|
FailedEventInvocation |
fail(Exception e)
Creates a new
FailedEventInvocation holding the given exception. |
Event<?,?> |
getEvent()
Gets the event to notify the listener about.
|
Listener |
getListener()
Gets the listener which is notified.
|
void |
notifyListener()
Notifies the wrapped listener about the wrapped event.
|
static <L extends Listener,E extends Event<?,L>> |
of(L listener,
E event,
BiConsumer<L,E> method,
ExceptionCallback ec)
Creates a new EventInvocation.
|
static <L extends Listener,E extends Event<?,L>> EventInvocation of(L listener, E event, BiConsumer<L,E> method, ExceptionCallback ec)
L - The type of the listener.E - The type of the event.listener - The listener to notify.event - The event to pass to the listener.method - The method of the listener to call.ec - The exception handler.Event<?,?> getEvent()
Listener getListener()
void notifyListener()
EventProvider
and ExceptionCallback.FailedEventInvocation fail(Exception e)
FailedEventInvocation holding the given exception.e - The exception which occurred while notifying the listener.Copyright © 2014–2015. All rights reserved.