1. // this is for providing of scenario state synchronization
  2. protected static class ScenarioInterceptor implements MethodInterceptor {
  3. @Override
  4. public Object intercept(Object obj, Method method, Object[] args,
  5. MethodProxy proxy) throws Throwable {
  6. try {
  7. Object result = proxy.invokeSuper(obj, args);
  8. return result;
  9. } finally {
  10. Collection<CommonOneCStepSet> existengStepSets = ((CommonOneCStepSet) obj).initedStepSetMap
  11. .values();
  12. for (CommonOneCStepSet oneCStepSet : existengStepSets) {
  13. oneCStepSet.syncStepSets((CommonOneCStepSet) obj);
  14. }
  15. }
  16. }
  17. }