BoundedContextBuilder

public final class BoundedContextBuilder

A builder for producing BoundedContext instances.

Functions

Link copied to clipboard
public BoundedContextBuilder add(Repository<? extends Object, ? extends Object> repository)
Adds the passed repository to the registration list which will be processed after the Bounded Context is created.
public BoundedContextBuilder add<I, E extends Entity<I, ? extends Object>>(Class<E> entityClass)
Adds the default repository for the passed entity class to the repository registration list.
Link copied to clipboard
Adds the passed command dispatcher to the dispatcher registration list which will be processed after the Bounded Context is created.
Link copied to clipboard
Adds a filter for commands.
Link copied to clipboard
Adds a listener for commands posted to the CommandBus of the context being built.
Link copied to clipboard
Adds the passed event dispatcher to the dispatcher registration list which will be processed after the Bounded Context is created.
Link copied to clipboard
Adds a filter for events.
Link copied to clipboard
Adds a listener of the events posted to the EventBus of the context being built.
Link copied to clipboard
Creates a new builder for a single tenant test-only Bounded Context.
public static BoundedContextBuilder assumingTests(boolean multitenant)
Creates a new builder for a test-only bounded context.
Link copied to clipboard
Creates a new instance of BoundedContext with the set configurations.
Link copied to clipboard
public ImmutableList<CommandDispatcher> commandDispatchers()
Obtains the list of command dispatchers added to the builder by the time of the call.
Link copied to clipboard
Sets a custom Enricher for events posted to the EventBus of the context being built.
Link copied to clipboard
public ImmutableList<EventDispatcher> eventDispatchers()
Obtains the list of event dispatchers added to the builder by the time of the call.
Link copied to clipboard
Obtains EventEnricher assigned to the context to be built, or empty Optional if no enricher was assigned prior to this call.
Link copied to clipboard
public boolean isMultitenant()
Link copied to clipboard
public BoundedContextName name()
Returns the name of the resulting context.
Link copied to clipboard
public BoundedContextBuilder remove(Repository<? extends Object, ? extends Object> repository)
Removes the passed repository from the registration list.
public BoundedContextBuilder remove<I, E extends Entity<I, ? extends Object>>(Class<E> entityClass)
Removes the repository from the registration list by the passed entity class.
Link copied to clipboard
Removes the passed command dispatcher from the corresponding registration list.
Link copied to clipboard
Removes the passed event dispatcher from the corresponding registration list.
Link copied to clipboard
public ImmutableList<Repository<?, ?>> repositories()
Obtains the list of repositories added to the builder by the time of the call.
Link copied to clipboard
Sets the supplier of AggregateRootDirectory-s to use in the built context.
Link copied to clipboard
Link copied to clipboard
public ContextSpec spec()
Obtains the context spec.
Link copied to clipboard
Obtains the configuration of the System context.
Link copied to clipboard
public Optional<? extends TenantIndex> tenantIndex()
Obtains TenantIndex implementation associated with the Bounded Context.
Link copied to clipboard
Creates a copy of this context builder for the purpose of testing.