Examples of attachResource()


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

        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

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

        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

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

    }

    @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

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

            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.