Examples of MethodSelfTransition


Examples of org.apache.mina.statemachine.transition.MethodSelfTransition

                throw new StateMachineCreationException("Error encountered "
                        + "when processing onEntry annotation in method " + m + ". state " + onEntryAnnotation.value()
                        + " not Found.");

            }
            state.addOnEntrySelfTransaction(new MethodSelfTransition(m, handler));
        }

        if (m.isAnnotationPresent(OnExit.class)) {
            OnExit onExitAnnotation = (OnExit) m.getAnnotation(onExitSelfTransitionAnnotation);
            State state = states.get(onExitAnnotation.value());
            if (state == null) {
                throw new StateMachineCreationException("Error encountered "
                        + "when processing onExit annotation in method " + m + ". state " + onExitAnnotation.value()
                        + " not Found.");

            }
            state.addOnExitSelfTransaction(new MethodSelfTransition(m, handler));
        }

    }
View Full Code Here

Examples of org.apache.mina.statemachine.transition.MethodSelfTransition

                throw new StateMachineCreationException("Error encountered "
                        + "when processing onEntry annotation in method " + m + ". state " + onEntryAnnotation.value()
                        + " not Found.");

            }
            state.addOnEntrySelfTransaction(new MethodSelfTransition(m, handler));
        }

        if (m.isAnnotationPresent(OnExit.class)) {
            OnExit onExitAnnotation = (OnExit) m.getAnnotation(onExitSelfTransitionAnnotation);
            State state = states.get(onExitAnnotation.value());
            if (state == null) {
                throw new StateMachineCreationException("Error encountered "
                        + "when processing onExit annotation in method " + m + ". state " + onExitAnnotation.value()
                        + " not Found.");

            }
            state.addOnExitSelfTransaction(new MethodSelfTransition(m, handler));
        }

    }
View Full Code Here

Examples of org.apache.mina.statemachine.transition.MethodSelfTransition

        s3.addTransition(new MethodTransition("stop", s4, "stopped", handler));
        s3.addTransition(new MethodTransition("pause", s5, "paused", handler));
        s4.addTransition(new MethodTransition("eject", s1, "ejected", handler));
        s5.addTransition(new MethodTransition("pause", s3, "playing", handler));

        s2.addOnEntrySelfTransaction(new MethodSelfTransition("onEntryS2", handler));
        s2.addOnExitSelfTransaction(new MethodSelfTransition("onExitS2", handler));

        s3.addOnEntrySelfTransaction(new MethodSelfTransition("onEntryS3", handler));
        s3.addOnExitSelfTransaction(new MethodSelfTransition("onExitS3", handler));

        s4.addOnEntrySelfTransaction(new MethodSelfTransition("onEntryS4", handler));
        s4.addOnExitSelfTransaction(new MethodSelfTransition("onExitS4", handler));

        StateMachine sm = new StateMachine(new State[] { s1, s2, s3, s4, s5 }, "s1");
        TapeDeck player = new StateMachineProxyBuilder().create(TapeDeck.class, sm);
        player.insert("Kings of convenience - Riot on an empty street");
        player.start();
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.