Package org.axonframework.unitofwork

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


        UnitOfWork uow = DefaultUnitOfWork.startAndGet();
        GenericEventMessage<Object> event = new GenericEventMessage<Object>("First",
                                                                            Collections.<String, Object>singletonMap(
                                                                                    "continue",
                                                                                    true));
        uow.publishEvent(event,
                         eventBus);
        verify(eventListener, never()).handle(isA(EventMessage.class));
        doAnswer(new Answer() {
            @Override
            public Object answer(InvocationOnMock invocation) throws Throwable {
View Full Code Here


            EventBus eventBus = (EventBus) context.getScheduler().getContext().get(EVENT_BUS_KEY);
            UnitOfWorkFactory unitOfWorkFactory =
                    (UnitOfWorkFactory) context.getScheduler().getContext().get(UNIT_OF_WORK_FACTORY_KEY);
            UnitOfWork uow = unitOfWorkFactory.createUnitOfWork();
            try {
                uow.publishEvent(eventMessage, eventBus);
            } finally {
                uow.commit();
            }
            if (logger.isInfoEnabled()) {
                logger.info("Job successfully executed. Scheduled Event [{}] has been published.",
View Full Code Here

            if (logger.isInfoEnabled()) {
                logger.info("Triggered the publication of event [{}]", eventMessage.getPayloadType().getSimpleName());
            }
            UnitOfWork unitOfWork = unitOfWorkFactory.createUnitOfWork();
            try {
                unitOfWork.publishEvent(eventMessage, eventBus);
                unitOfWork.commit();
            } finally {
                tokens.remove(tokenId);
            }
        }
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.