Class GuavaPubsubBus

java.lang.Object
org.jenkinsci.plugins.pubsub.PubsubBus
org.jenkinsci.plugins.pubsub.GuavaPubsubBus
All Implemented Interfaces:
ExtensionPoint

public final class GuavaPubsubBus extends PubsubBus
Default PubsubBus implementation.

An in-memory implementation based on Google's Guava EventBus.

Use system property org.jenkins.pubsub.GuavaPubsubBus.MAX_THREADS to configure the thread pool size used by the bus. The default value is 5 threads (falling back to 0 when idle).

Author:
tom.fennelly@gmail.com
  • Constructor Details Link icon

    • GuavaPubsubBus Link icon

      public GuavaPubsubBus()
  • Method Details Link icon

    • publisher Link icon

      @NonNull protected ChannelPublisher publisher(@NonNull String channelName)
      Description copied from class: PubsubBus
      Get/create a new ChannelPublisher instance for the specified channel name.
      Specified by:
      publisher in class PubsubBus
      Parameters:
      channelName - The channel name.
      Returns:
      The ChannelPublisher instance.
    • subscribe2 Link icon

      public void subscribe2(@NonNull String channelName, @NonNull ChannelSubscriber subscriber, @NonNull org.springframework.security.core.Authentication authentication, @CheckForNull EventFilter eventFilter)
      Description copied from class: PubsubBus
      Subscribe to events on the specified event channel.
      Overrides:
      subscribe2 in class PubsubBus
      Parameters:
      channelName - The channel name.
      subscriber - The subscriber instance that will receive the events.
      authentication - The authentication to which the subscription is associated.
      eventFilter - A message filter, or null if no filtering is to be applied. This tells the bus to only forward messages that match the properties (names and values) specified in the filter.
    • unsubscribe Link icon

      public void unsubscribe(@NonNull String channelName, @NonNull ChannelSubscriber subscriber)
      Description copied from class: PubsubBus
      Unsubscribe from events on the specified event channel.
      Specified by:
      unsubscribe in class PubsubBus
      Parameters:
      channelName - The channel name.
      subscriber - The subscriber instance that was used to receive events.
    • start Link icon

      public void start()
      Description copied from class: PubsubBus
      will start the bus if it has been shutdown do not restart if already started
      Overrides:
      start in class PubsubBus
    • shutdown Link icon

      public void shutdown()
      Description copied from class: PubsubBus
      Shutdown the bus.
      Specified by:
      shutdown in class PubsubBus