Examples of SagaState


Examples of com.codebullets.sagalib.SagaState

    private Saga createSagaBasedOnId(final SagaType sagaType, final Object message) {
        Saga sagaToContinue = null;

        // saga id is known -> we can create saga directly from know state.
        SagaState state = stateStorage.load(sagaType.getSagaId());
        if (state != null) {
            sagaToContinue = continueSaga(state.getType(), state);
        } else {
            LOG.warn("No open saga state found. (message type = {}, saga type = {}, saga id = {})",
                     message.getClass(),
                     sagaType.getSagaClass(),
                     sagaType.getSagaId());
View Full Code Here

Examples of com.codebullets.sagalib.SagaState

        try {
            createdSaga = createNewSagaInstance(sagaToStart);
            createdSaga.createNewState();

            SagaState newState = createdSaga.state();
            newState.setSagaId(UUID.randomUUID().toString());
            newState.setType(sagaToStart.getName());
        } catch (Exception ex) {
            LOG.error("Unable to create new instance of saga type {}.", sagaToStart, ex);
        }

        return createdSaga;
View Full Code Here

Examples of com.codebullets.sagalib.SagaState

        try {
            Provider<? extends Saga> sagaProvider = providers.get(sagaToStart);
            createdSaga = sagaProvider.get();
            createdSaga.createNewState();

            SagaState newState = createdSaga.state();
            newState.setSagaId(UUID.randomUUID().toString());
            newState.setType(sagaToStart.getName());
        } catch (Exception ex) {
            LOG.error("Unable to create new instance of saga type {}.", sagaToStart, ex);
        }

        return createdSaga;
View Full Code Here

Examples of com.codebullets.sagalib.SagaState

     */
    @Override
    public SagaState load(final String sagaId) {
        checkNotNull(sagaId, "Saga id key must be set.");

        SagaState state;
        synchronized (sync) {
            state = storedStates.get(sagaId);
        }

        return state;
View Full Code Here

Examples of com.codebullets.sagalib.SagaState

    @Override
    public void delete(final String sagaId) {
        checkNotNull(sagaId, "Saga id key must be set.");

        synchronized (sync) {
            SagaState removedItem = storedStates.remove(sagaId);
            if (removedItem != null) {
                instanceKeyMap.remove(SagaMultiKey.create(removedItem), removedItem);
            }
        }
    }
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.