Package com.bnorm.infinite

Examples of com.bnorm.infinite.StateMachineException


                     * 3. Cancel from AsyncEventTask#get()
                     *     - Someone outside the state machine cancelled the submit or inject.
                     */
                } catch (ExecutionException e) {
                    // This is the exception we want to rethrow.  There was an issue performing a transition.
                    throw new StateMachineException(e);
                }
            }
        } finally {
            // If we ever stop running for whatever reason, make sure the state machine is marked as such.
            running.set(false);
View Full Code Here


    }

    @Override
    public Optional<Transition<S, C>> fire(E event) {
        if (stateMachineLock.isHeldByCurrentThread()) {
            throw new StateMachineException("StateMachine#fire(E) was called from within a synchronous Action or " +
                                                    "synchronous TransitionListener.\n" +
                                                    "Please use AsyncStateMachine#sumbit(E), " +
                                                    "AsyncStateMachine#inject(E), or an asynchronous Action or " +
                                                    "asynchronous TransitionListener.");
        }
        try {
            return submit(event, priority.getAndIncrement()).get();
        } catch (InterruptedException | ExecutionException e) {
            throw new StateMachineException(e);
        }
    }
View Full Code Here

    }

    @Override
    public StateBuilderBase<S, E, C> handle(E event, Transition<S, C> transition) {
        if (!Objects.equals(transition.getSource(), state)) {
            throw new StateMachineException(
                    "Illegal transition source.  Should be [" + state + "] Is [" + transition.getSource() + "]");
        }
        structure.addTransition(event, transition);
        return this;
    }
View Full Code Here

        if (internalParent != null) {
            internalParent.addChild(getInternalState());
            getInternalState().setParentState(internalParent);
            return this;
        } else {
            throw new StateMachineException(
                    "Requested parent state [" + parent + "] does not exist in the state machine." +
                            "  Configure parent states before configuring children states.");
        }
    }
View Full Code Here

    }

    @Override
    public StateBuilderBase<S, E, C> handle(E event, Transition<S, C> transition) {
        if (!transition.getSource().equals(getInternalState().getState())) {
            throw new StateMachineException(
                    "Illegal transition source.  Should be [" + getInternalState().getState() + "] Is [" + transition.getSource() + "]");
        }
        Set<Transition<S, C>> handlers = transitions.computeIfAbsent(event, e -> new LinkedHashSet<>());
        handlers.add(transition);
        return this;
View Full Code Here

        if (internalParent != null) {
            internalParent.addChild(getInternalState());
            getInternalState().setParentState(internalParent);
            return this;
        } else {
            throw new StateMachineException(
                    "Requested parent state [" + parent + "] does not exist in the state machine." +
                            "  Configure parent states before configuring children states.");
        }
    }
View Full Code Here

    }

    @Override
    public StateBuilderBase<S, E, C> handle(E event, Transition<S, C> transition) {
        if (!transition.getSource().equals(getInternalState().getState())) {
            throw new StateMachineException(
                    "Illegal transition source.  Should be [" + getInternalState().getState() + "] Is [" + transition.getSource() + "]");
        }
        Set<Transition<S, C>> handlers = transitions.computeIfAbsent(event, e -> new LinkedHashSet<>());
        handlers.add(transition);
        return this;
View Full Code Here

TOP

Related Classes of com.bnorm.infinite.StateMachineException

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.