Package org.axonframework.eventsourcing

Examples of org.axonframework.eventsourcing.EventSourcedAggregateRoot


        AggregateFactory<?> aggregateFactory = aggregateFactories.get(typeIdentifier);

        DomainEventMessage firstEvent = eventStream.peek();
        Object aggregateIdentifier = firstEvent.getAggregateIdentifier();

        EventSourcedAggregateRoot aggregate = aggregateFactory.createAggregate(aggregateIdentifier, firstEvent);
        aggregate.initializeState(eventStream);

        return new GenericDomainEventMessage<EventSourcedAggregateRoot>(
                aggregate.getIdentifier(), aggregate.getVersion(), aggregate);
    }
View Full Code Here


                reschedule(entry);
            } else {
                DisruptorUnitOfWork unitOfWork = entry.getUnitOfWork();
                CurrentUnitOfWork.set(unitOfWork);
                try {
                    EventSourcedAggregateRoot aggregate = unitOfWork.getAggregate();
                    if (aggregate != null && blackListedAggregates.contains(aggregate.getIdentifier())) {
                        rejectExecution(entry, unitOfWork, entry.getAggregateIdentifier());
                    } else {
                        processPublication(entry, unitOfWork, aggregate);
                    }
                } finally {
View Full Code Here

    private void detectIllegalStateChanges() {
        if (aggregateIdentifier != null && workingAggregate != null && reportIllegalStateChange) {
            UnitOfWork uow = DefaultUnitOfWork.startAndGet();
            try {
                EventSourcedAggregateRoot aggregate2 = repository.load(aggregateIdentifier);
                if (workingAggregate.isDeleted()) {
                    throw new AxonAssertionError("The working aggregate was considered deleted, "
                                                         + "but the Repository still contains a non-deleted copy of "
                                                         + "the aggregate. Make sure the aggregate explicitly marks "
                                                         + "itself as deleted in an EventHandler.");
View Full Code Here

TOP

Related Classes of org.axonframework.eventsourcing.EventSourcedAggregateRoot

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.