我现在需要nutz-ioc管理自定义Bean,以实现activiti的监听器功能。
public class ActivitiFactory {
private static final Log log = Logs.get();
public static ProcessEngine build(DataSource ds, PropertiesProxy conf) {
StandaloneProcessEngineConfiguration spec = new StandaloneProcessEngineConfiguration();
spec.setDataSource(ds);
Mirror<StandaloneProcessEngineConfiguration> mirror = Mirror.me(StandaloneProcessEngineConfiguration.class);
for (String key : conf.keys()) {
if (!key.startsWith("activiti."))
continue;
if (log.isDebugEnabled())
log.debugf("%s=%s", key, conf.get(key));
mirror.setValue(spec, key.substring("activiti.".length()), conf.get(key));
}
if (log.isDebugEnabled())
log.debug("databaseSchemaUpdate = [" + spec.getDatabaseSchemaUpdate() + "]");
return spec.buildProcessEngine();
}
}
我看了下源码,conf中恐怕无法定义Map属性。
如果是这样的话,需要 build方法增加一个Map<String, Object>参数(beans),然后设置到spec里面(spec.setBeans(beans);
)?