//定义解决对象工厂
DefaultResolverFactory rf=new DefaultResolverFactory();
rf.addResolver(resolverId, new HelloResolver());
//创建配置
Configuration cfg=new Configuration(rf);
//创建动作
Action action=new Action(actionName);
{
Invoke invoke=new Invoke(
null,
"hello",
new Arg[]{new Arg(argKey_hello_to), new Arg(argKey_hello_repeat)},
resultKey_hello,
new FactoryResolverProvider(rf, resolverId));
action.addExecutable(invoke);
}
{
Invoke invoke=new Invoke(
null,
"printObject",
new Arg[]{new Arg(resultKey_hello)},
null,
HelloResolver.class);
action.addExecutable(invoke);
}
cfg.addExecutable(action);
//创建执行器
Executor executor=new DefaultExecutor(cfg);
ConvertableObjectSource os = new HashMapObjectSource(new DefaultGenericConverter());