View Javadoc

1   package com.atlassian.event.spi;
2   
3   import javax.annotation.Nonnull;
4   import java.util.concurrent.Executor;
5   
6   /**
7    * An optional SPI that allows you to hook into the creation of the {@link Runnable} that gets supplied to the
8    * {@link Executor} that's returned from the {@link EventExecutorFactory}.
9    *
10   * @since v2.3
11   */
12  public interface EventRunnableFactory {
13      /**
14       * Returns a new {@link Runnable}. The {@link Runnable} should call invoker.invoke(event) at some stage.
15       *
16       * @param invoker
17       * @param event
18       * @return
19       */
20      @Nonnull
21      Runnable getRunnable(final ListenerInvoker invoker, final Object event);
22  }