Interface DomainEventPublisher

All Known Implementing Classes:
SimpleDomainEventPublisher, ThreadLocalDomainEventPublisher

public interface DomainEventPublisher
A publisher of domain events. Subscribers can register with implementations of this interface to be notified when events occur and are published.
Author:
RealLifeDeveloper
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Publishes a domain event, i.e., notifies each registered subscriber about the event.
    void
    Registers an event handler with this publisher.
  • Method Details

    • publish

      void publish(DomainEvent event)
      Publishes a domain event, i.e., notifies each registered subscriber about the event.
      Parameters:
      event - the event to publish
    • subscribe

      void subscribe(DomainEventSubscriber<? extends DomainEvent> subscriber)
      Registers an event handler with this publisher.
      Parameters:
      subscriber - the event handler to register
      Throws:
      IllegalArgumentException - if subscriber is null