Examples of AggregateRoot


Examples of com.xebia.cqrs.domain.AggregateRoot

            }
            addToSession(aggregate);
        }

        private <T extends AggregateRoot> void addToSession(T aggregate) {
            AggregateRoot previous = aggregatesById.put(aggregate.getVersionedId().getId(), aggregate);
            if (previous != null && previous != aggregate) {
                throw new IllegalStateException("multiple instances with same id " + aggregate.getVersionedId().getId());
            }
        }
View Full Code Here

Examples of org.axonframework.domain.AggregateRoot

    @Test
    public void testObtainAndReleaseLocks() {
        PessimisticLockManager manager = new PessimisticLockManager();
        UUID identifier = UUID.randomUUID();
        AggregateRoot aggregateRoot = mock(AggregateRoot.class);
        when(aggregateRoot.getIdentifier()).thenReturn(identifier);

        assertFalse(manager.validateLock(aggregateRoot));

        manager.obtainLock(identifier);
        assertTrue(manager.validateLock(aggregateRoot));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.