Codota Logo
AggregateAnnotationCommandHandler$Builder
Code IndexAdd Codota to your IDE (free)

How to use
AggregateAnnotationCommandHandler$Builder
in
org.axonframework.modelling.command

Best Java code snippets using org.axonframework.modelling.command.AggregateAnnotationCommandHandler$Builder (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: AxonFramework/AxonFramework

commandHandler = new Component<>(() -> parent, "aggregateCommandHandler<" + aggregate.getSimpleName() + ">",
                 c -> AggregateAnnotationCommandHandler.<A>builder()
                     .repository(repository.get())
                     .commandTargetResolver(commandTargetResolver.get())
                     .aggregateModel(metaModel.get())
                     .build());
origin: AxonFramework/AxonFramework

/**
 * Instantiate a {@link AggregateAnnotationCommandHandler} based on the fields contained in the {@link Builder}.
 * <p>
 * Will assert that the {@link Repository} and {@link CommandTargetResolver} are not {@code null}, and will throw
 * an {@link AxonConfigurationException} if either of them is {@code null}. Next to that, the provided Builder's
 * goal is to create an {@link AggregateModel} (describing the structure of a given aggregate). To instantiate this
 * AggregateModel, either an {@link AggregateModel} can be provided directly or an {@code aggregateType} of type
 * {@link Class} can be used. The latter will internally resolve to an AggregateModel. Thus, either the
 * AggregateModel <b>or</b> the {@code aggregateType} should be provided. An AxonConfigurationException is thrown
 * if this criteria is not met.
 *
 * @param builder the {@link Builder} used to instantiate a {@link AggregateAnnotationCommandHandler} instance
 */
protected AggregateAnnotationCommandHandler(Builder<T> builder) {
  builder.validate();
  this.repository = builder.repository;
  this.commandTargetResolver = builder.commandTargetResolver;
  this.supportedCommandNames = new HashSet<>();
  this.handlers = initializeHandlers(builder.buildAggregateModel());
}
origin: AxonFramework/AxonFramework

private void registerAggregateCommandHandlers() {
  ensureRepositoryConfiguration();
  if (!explicitCommandHandlersSet) {
    AggregateAnnotationCommandHandler.Builder<T> builder = AggregateAnnotationCommandHandler.<T>builder()
        .aggregateType(aggregateType)
        .parameterResolverFactory(parameterResolverFactory)
        .repository(this.repository);
    if (commandTargetResolver != null) {
      builder.commandTargetResolver(commandTargetResolver);
    }
    AggregateAnnotationCommandHandler<T> handler = builder.build();
    handler.subscribe(commandBus);
  }
}
origin: AxonFramework/AxonFramework

@SuppressWarnings("unchecked")
@Before
public void setUp() {
  eventStore = spy(EmbeddedEventStore.builder().storageEngine(new InMemoryEventStorageEngine()).build());
  Repository<MyAggregate> myAggregateRepository = EventSourcingRepository.builder(MyAggregate.class)
                                      .eventStore(eventStore)
                                      .build();
  CommandBus commandBus = SimpleCommandBus.builder().build();
  commandGateway = DefaultCommandGateway.builder().commandBus(commandBus).build();
  AggregateAnnotationCommandHandler<MyAggregate> myAggregateCommandHandler =
      AggregateAnnotationCommandHandler.<MyAggregate>builder()
          .aggregateType(MyAggregate.class)
          .repository(myAggregateRepository)
          .build();
  myAggregateCommandHandler.subscribe(commandBus);
}
origin: AxonFramework/AxonFramework

/**
 * Instantiate a Builder to be able to create a {@link AggregateAnnotationCommandHandler}.
 * <p>
 * The {@link CommandTargetResolver} is defaulted to amn {@link AnnotationCommandTargetResolver}
 * The {@link Repository} is a <b>hard requirement</b> and as such should be provided.
 * Next to that, this Builder's goal is to provide an {@link AggregateModel} (describing the structure of a given
 * aggregate). To instantiate this AggregateModel, either an {@link AggregateModel} can be provided directly or an
 * {@code aggregateType} of type {@link Class} can be used. The latter will internally resolve to an
 * AggregateModel. Thus, either the AggregateModel <b>or</b> the {@code aggregateType} should be provided.
 *
 * @param <T> the type of aggregate this {@link AggregateAnnotationCommandHandler} handles commands for
 * @return a Builder to be able to create a {@link AggregateAnnotationCommandHandler}
 */
public static <T> Builder<T> builder() {
  return new Builder<>();
}
origin: AxonFramework/AxonFramework

/**
 * Instantiate the {@link AggregateModel} of generic type {@code T} describing the structure of the Aggregate
 * this {@link AggregateAnnotationCommandHandler} will handle commands for.
 *
 * @return a {@link AggregateModel} of generic type {@code T} describing the Aggregate this {@link
 * AggregateAnnotationCommandHandler} will handle commands for
 */
private AggregateModel<T> buildAggregateModel() {
  if (aggregateModel == null) {
    return inspectAggregateModel();
  } else {
    return aggregateModel;
  }
}
origin: org.axonframework/axon-modelling

/**
 * Instantiate the {@link AggregateModel} of generic type {@code T} describing the structure of the Aggregate
 * this {@link AggregateAnnotationCommandHandler} will handle commands for.
 *
 * @return a {@link AggregateModel} of generic type {@code T} describing the Aggregate this {@link
 * AggregateAnnotationCommandHandler} will handle commands for
 */
private AggregateModel<T> buildAggregateModel() {
  if (aggregateModel == null) {
    return inspectAggregateModel();
  } else {
    return aggregateModel;
  }
}
origin: org.axonframework/axon-modelling

/**
 * Instantiate a {@link AggregateAnnotationCommandHandler} based on the fields contained in the {@link Builder}.
 * <p>
 * Will assert that the {@link Repository} and {@link CommandTargetResolver} are not {@code null}, and will throw
 * an {@link AxonConfigurationException} if either of them is {@code null}. Next to that, the provided Builder's
 * goal is to create an {@link AggregateModel} (describing the structure of a given aggregate). To instantiate this
 * AggregateModel, either an {@link AggregateModel} can be provided directly or an {@code aggregateType} of type
 * {@link Class} can be used. The latter will internally resolve to an AggregateModel. Thus, either the
 * AggregateModel <b>or</b> the {@code aggregateType} should be provided. An AxonConfigurationException is thrown
 * if this criteria is not met.
 *
 * @param builder the {@link Builder} used to instantiate a {@link AggregateAnnotationCommandHandler} instance
 */
protected AggregateAnnotationCommandHandler(Builder<T> builder) {
  builder.validate();
  this.repository = builder.repository;
  this.commandTargetResolver = builder.commandTargetResolver;
  this.supportedCommandNames = new HashSet<>();
  this.handlers = initializeHandlers(builder.buildAggregateModel());
}
origin: org.axonframework/axon-modelling

/**
 * Instantiate a Builder to be able to create a {@link AggregateAnnotationCommandHandler}.
 * <p>
 * The {@link CommandTargetResolver} is defaulted to amn {@link AnnotationCommandTargetResolver}
 * The {@link Repository} is a <b>hard requirement</b> and as such should be provided.
 * Next to that, this Builder's goal is to provide an {@link AggregateModel} (describing the structure of a given
 * aggregate). To instantiate this AggregateModel, either an {@link AggregateModel} can be provided directly or an
 * {@code aggregateType} of type {@link Class} can be used. The latter will internally resolve to an
 * AggregateModel. Thus, either the AggregateModel <b>or</b> the {@code aggregateType} should be provided.
 *
 * @param <T> the type of aggregate this {@link AggregateAnnotationCommandHandler} handles commands for
 * @return a Builder to be able to create a {@link AggregateAnnotationCommandHandler}
 */
public static <T> Builder<T> builder() {
  return new Builder<>();
}
origin: org.axonframework/axon-configuration

commandHandler = new Component<>(() -> parent, "aggregateCommandHandler<" + aggregate.getSimpleName() + ">",
                 c -> AggregateAnnotationCommandHandler.<A>builder()
                     .repository(repository.get())
                     .commandTargetResolver(commandTargetResolver.get())
                     .aggregateModel(metaModel.get())
                     .build());
org.axonframework.modelling.commandAggregateAnnotationCommandHandler$Builder

Javadoc

Builder class to instantiate a AggregateAnnotationCommandHandler.

The CommandTargetResolver is defaulted to an AnnotationCommandTargetResolverThe Repository is a hard requirement and as such should be provided. Next to that, this Builder's goal is to provide an AggregateModel (describing the structure of a given aggregate). To instantiate this AggregateModel, either an AggregateModel can be provided directly or an aggregateType of type Class can be used. The latter will internally resolve to an AggregateModel. Thus, either the AggregateModel or the aggregateType should be provided.

Most used methods

  • build
    Initializes a AggregateAnnotationCommandHandler as specified through this Builder.
  • repository
    Sets the Repository used to add and load Aggregate instances of generic type T upon handling command
  • aggregateType
    Sets the aggregateType as a Class, specifying the type of aggregate an AggregateModelshould be creat
  • commandTargetResolver
    Sets the CommandTargetResolver used to resolve the command handling target. Defaults to an Annotatio
  • <init>
  • aggregateModel
    Sets the AggregateModel of generic type T, describing the structure of the aggregate the AnnotationC
  • inspectAggregateModel
  • parameterResolverFactory
    Sets the ParameterResolverFactory used to resolve parameters for annotated handlers contained in the
  • validate
    Validates whether the fields contained in this Builder are set accordingly.

Popular in Java

  • Finding current android device location
  • compareTo (BigDecimal)
  • getApplicationContext (Context)
  • startActivity (Activity)
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now