Examples of SagaState


Examples of com.codebullets.sagalib.SagaState

     */
    private Saga createSagaForTimeoutHandling(final Timeout timeout) {
        Saga saga = null;

        // timeout does not need key extraction
        SagaState state = stateStorage.load(timeout.getSagaId());
        if (state != null) {
            saga = continueSaga(state.getType(), state);
        } else {
            LOG.warn("No open saga state found. Timeout = {}", timeout);
        }

        return saga;
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

    private Saga createSagaBasedOnId(final String sagaId) {
        Saga sagaToContinue = null;

        // saga id is know -> we can create saga directly from know state.
        SagaState state = stateStorage.load(sagaId);
        if (state != null) {
            sagaToContinue = continueSaga(state.getType(), state);
        } else {
            LOG.warn("No open saga state found. saga id = {}", sagaId);
        }

        return sagaToContinue;
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

    private Saga createSagaBasedOnId(final String sagaId) {
        Saga sagaToContinue = null;

        // saga id is know -> we can create saga directly from know state.
        SagaState state = stateStorage.load(sagaId);
        if (state != null) {
            sagaToContinue = continueSaga(state.getType(), state);
        } else {
            LOG.warn("No open saga state found. saga id = {}", sagaId);
        }

        return sagaToContinue;
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

     */
    private Saga createSagaForTimeoutHandling(final Timeout timeout) {
        Saga saga = null;

        // timeout does not need key extraction
        SagaState state = stateStorage.load(timeout.getSagaId());
        if (state != null) {
            saga = continueSaga(state.getType(), state);
        } else {
            LOG.warn("No open saga state found. Timeout = {}", timeout);
        }

        return saga;
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

     */
    @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) {
                for (String instanceKey : removedItem.instanceKeys()) {
                    instanceKeyMap.remove(SagaMultiKey.create(removedItem.getType(), instanceKey), 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.