Class 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 Detail

      • GuavaPubsubBus

        public GuavaPubsubBus()
    • Method Detail

      • subscribe2

        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

        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

        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

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