All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.squirrelframework.foundation.fsm.ImmutableTransition Maven / Gradle / Ivy

Go to download

foundation module of squirrel framework which provided event driven infrastructure and a finite state machine implementation.

There is a newer version: 0.3.10
Show newest version
package org.squirrelframework.foundation.fsm;

import java.util.List;

import org.squirrelframework.foundation.component.SquirrelComponent;

/**
 * 

Transition A directed relationship between two states which represents the complete response * of a state machine to an occurrence of an event of a particular type.

* *

Condition A constraint which must evaluate to true after the trigger occurs in order for the * transition to complete.

* *

Transition Action An activity which is executed when performing a certain transition.

* *

Trigger(Event) A triggering activity that causes a transition to occur.

* * @author Henry.He * * @param type of State Machine * @param type of State * @param type of Event * @param type of Context */ public interface ImmutableTransition, S, E, C> extends Visitable, SquirrelComponent { /** * @return Transition source state */ ImmutableState getSourceState(); /** * @return Transition destination state */ ImmutableState getTargetState(); /** * @return Transition action list */ List> getActions(); /** * Execute transition under state context * @param stateContext * @return state when transition finished */ ImmutableState transit(StateContext stateContext); /** * @return Condition of the transition */ Condition getCondition(); /** * @return Event that can trigger the transition */ E getEvent(); /** * @return type of transition */ TransitionType getType(); boolean isMatch(S fromState, S toState, E event); boolean isMatch(S fromState, S toState, E event, Class condClazz, TransitionType type); /** * Notify transition when receiving event * @param stateContext */ void internalFire(StateContext stateContext); /** * Verify tranistion correctness */ void verify(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy