Package com.codebullets.sagalib.context

Examples of com.codebullets.sagalib.context.ExecutionContext


    private void handleSagaMessage(final Object invokeParam) throws InvocationTargetException, IllegalAccessException {
        Collection<SagaInstanceDescription> sagaDescriptions = sagaFactory.create(invokeParam);
        if (sagaDescriptions.isEmpty()) {
            LOG.warn("No saga found to handle message. {}", invokeParam);
        } else {
            ExecutionContext context = contextProvider.get();

            for (SagaInstanceDescription sagaDescription : sagaDescriptions) {
                Saga saga = sagaDescription.getSaga();
                setSagaExecutionContext(saga, context);

                invoker.invoke(saga, invokeParam);
                updateStateStorage(sagaDescription);

                if (context.dispatchingStopped()) {
                    LOG.debug("Handler dispatching stopped after invoking saga {}.", sagaDescription.getSaga().getClass().getSimpleName());
                    break;
                }
            }
        }
View Full Code Here

TOP

Related Classes of com.codebullets.sagalib.context.ExecutionContext

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.