Package org.axonframework.unitofwork

Examples of org.axonframework.unitofwork.UnitOfWork.attachResource()


    }

    @Test
    public void testResourceInheritance() {
        UnitOfWork outerUoW = DefaultUnitOfWork.startAndGet();
        outerUoW.attachResource("notInherited", "resourceA");
        outerUoW.attachResource("explicitlyNotInherited", "resourceA", false);
        outerUoW.attachResource("inherited", "resourceA", true);

        outerUoW.attachResource("inheritanceOverwritten", "resourceA", true);
        outerUoW.attachResource("inheritanceOverwritten", "resourceA");
View Full Code Here


    @Test
    public void testResourceInheritance() {
        UnitOfWork outerUoW = DefaultUnitOfWork.startAndGet();
        outerUoW.attachResource("notInherited", "resourceA");
        outerUoW.attachResource("explicitlyNotInherited", "resourceA", false);
        outerUoW.attachResource("inherited", "resourceA", true);

        outerUoW.attachResource("inheritanceOverwritten", "resourceA", true);
        outerUoW.attachResource("inheritanceOverwritten", "resourceA");
View Full Code Here

    @Test
    public void testResourceInheritance() {
        UnitOfWork outerUoW = DefaultUnitOfWork.startAndGet();
        outerUoW.attachResource("notInherited", "resourceA");
        outerUoW.attachResource("explicitlyNotInherited", "resourceA", false);
        outerUoW.attachResource("inherited", "resourceA", true);

        outerUoW.attachResource("inheritanceOverwritten", "resourceA", true);
        outerUoW.attachResource("inheritanceOverwritten", "resourceA");

        outerUoW.attachResource("inheritedAfterAll", "resourceA");
View Full Code Here

        UnitOfWork outerUoW = DefaultUnitOfWork.startAndGet();
        outerUoW.attachResource("notInherited", "resourceA");
        outerUoW.attachResource("explicitlyNotInherited", "resourceA", false);
        outerUoW.attachResource("inherited", "resourceA", true);

        outerUoW.attachResource("inheritanceOverwritten", "resourceA", true);
        outerUoW.attachResource("inheritanceOverwritten", "resourceA");

        outerUoW.attachResource("inheritedAfterAll", "resourceA");
        outerUoW.attachResource("inheritedAfterAll", "resourceA", true);
View Full Code Here

        outerUoW.attachResource("notInherited", "resourceA");
        outerUoW.attachResource("explicitlyNotInherited", "resourceA", false);
        outerUoW.attachResource("inherited", "resourceA", true);

        outerUoW.attachResource("inheritanceOverwritten", "resourceA", true);
        outerUoW.attachResource("inheritanceOverwritten", "resourceA");

        outerUoW.attachResource("inheritedAfterAll", "resourceA");
        outerUoW.attachResource("inheritedAfterAll", "resourceA", true);

        UnitOfWork innerUoW = DefaultUnitOfWork.startAndGet();
View Full Code Here

        outerUoW.attachResource("inherited", "resourceA", true);

        outerUoW.attachResource("inheritanceOverwritten", "resourceA", true);
        outerUoW.attachResource("inheritanceOverwritten", "resourceA");

        outerUoW.attachResource("inheritedAfterAll", "resourceA");
        outerUoW.attachResource("inheritedAfterAll", "resourceA", true);

        UnitOfWork innerUoW = DefaultUnitOfWork.startAndGet();
        assertNotNull(innerUoW.getResource("inherited"));
        assertNotNull(innerUoW.getResource("inheritedAfterAll"));
View Full Code Here

        outerUoW.attachResource("inheritanceOverwritten", "resourceA", true);
        outerUoW.attachResource("inheritanceOverwritten", "resourceA");

        outerUoW.attachResource("inheritedAfterAll", "resourceA");
        outerUoW.attachResource("inheritedAfterAll", "resourceA", true);

        UnitOfWork innerUoW = DefaultUnitOfWork.startAndGet();
        assertNotNull(innerUoW.getResource("inherited"));
        assertNotNull(innerUoW.getResource("inheritedAfterAll"));
        assertNull(innerUoW.getResource("notInherited"));
View Full Code Here

    }

    @Test
    public void testAggregateRetrievesParameterResolverFactoryFromUnitOfWork() {
        UnitOfWork uow = DefaultUnitOfWork.startAndGet();
        uow.attachResource(ParameterResolverFactory.class.getName(), MultiParameterResolverFactory.ordered(
                ClasspathParameterResolverFactory.forClass(CustomParameterAggregateRoot.class),
                new ParameterResolverFactory() {
                    @Override
                    public ParameterResolver createInstance(Annotation[] memberAnnotations, Class<?> parameterType,
                                                            Annotation[] parameterAnnotations) {
View Full Code Here

            final Connection delegateConnection = delegate.getConnection();
            connection = ConnectionWrapperFactory.wrap(delegateConnection,
                                                       UoWAttachedConnection.class,
                                                       new UoWAttachedConnectionImpl(delegateConnection),
                                                       new ConnectionWrapperFactory.NoOpCloseHandler());
            uow.attachResource(CONNECTION_RESOURCE_NAME, connection, inherited);
            uow.registerListener(new ConnectionManagingUnitOfWorkListenerAdapter());
        }
        return connection;
    }
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.