色偷偷精品伊人,欧洲久久精品,欧美综合婷婷骚逼,国产AV主播,国产最新探花在线,九色在线视频一区,伊人大交九 欧美,1769亚洲,黄色成人av

240 發(fā)簡信
IP屬地:山西
  • MyStateMachineUtils類使用反射就能解決包名問題了。
    public abstract class MyStateMachineUtils extends StateMachineUtils {

    public static <S, E> void setCurrentState(StateMachine<S, E> stateMachine, S state) {
    if (stateMachine instanceof AbstractStateMachine) {
    setCurrentState((AbstractStateMachine<S, E>) stateMachine, state);

    System.out.println("StateMachine Current:" + stateMachine);
    } else {
    throw new IllegalArgumentException("Provided StateMachine is not a valid type");
    }
    }

    public static <S, E> void setCurrentState(AbstractStateMachine<S, E> stateMachine, S state) {
    Method method = ReflectUtil.getMethod(stateMachine.getClass(),"setCurrentStateInternal"
    ,State.class, Message.class, Transition.class,Boolean.class,StateMachine.class,
    Collection.class,Collection.class);
    method.setAccessible(true);
    ReflectionUtils.invokeMethod(method,stateMachine,findState(stateMachine, state), null, null, false, stateMachine,null,null);
    }

    private static <S, E> State<S, E> findState(AbstractStateMachine<S, E> stateMachine, S stateId) {
    for (State<S, E> state : stateMachine.getStates()) {
    if (state.getId() == stateId) {
    return state;
    }
    }

    throw new IllegalArgumentException("Specified State ID is not valid");
    }
    }

    ReflectUtil是hutool里的,ReflectionUtils是spring的。
    ReflectUtil能反射出方法但執(zhí)行不了,ReflectionUtils反射不出方法,所以混著用

  • 想請問下博主,既然可以直接設(shè)置當(dāng)前狀態(tài)機(jī)狀態(tài)了,還需要持久化嗎

    Spring StateMachine狀態(tài)機(jī)引擎在項(xiàng)目中的應(yīng)用(八)-靈活指定引擎實(shí)例狀態(tài)

    一直以來,總覺得ssm不夠靈活,主要原因是沒找到為狀態(tài)機(jī)指定狀態(tài)的方式,也就意味著狀態(tài)機(jī)引擎實(shí)例必須要跟對應(yīng)的業(yè)務(wù)數(shù)據(jù)一起持久化,雖然ssm提供了多重持久化的方式,依然覺得有...

成都市| 闻喜县| 太和县| 繁昌县| 青田县| 浏阳市| 佛教| 吉林省| 潼南县| 崇义县| 盱眙县| 四子王旗| 郁南县| 萝北县| 富裕县| 大同市| 寻甸| 吉隆县| 赤水市| 建始县| 呈贡县| 浦北县| 桐柏县| 南陵县| 临沂市| 高台县| 烟台市| 鱼台县| 安福县| 兴和县| 府谷县| 海宁市| 和林格尔县| 阿瓦提县| 阿勒泰市| 吉安市| 齐齐哈尔市| 扎鲁特旗| 阜阳市| 托克托县| 五家渠市|