Add DFA of extract the parameter by provider

Add DFA of extract the parameter by provider
This commit is contained in:
coderfengyun 2014-04-11 16:43:07 +08:00
parent 0238c8d91c
commit f2863281f6
6 changed files with 35 additions and 17 deletions

View File

@ -78,9 +78,4 @@ public class PluginController {
return model; return model;
} }
@RequestMapping(value = "/info", method = RequestMethod.GET)
@ResponseBody
public void info() {
}
} }

View File

@ -11,7 +11,6 @@ import org.apache.log4j.Logger;
import org.bench4q.agent.helper.ClassHelper; import org.bench4q.agent.helper.ClassHelper;
import org.bench4q.agent.helper.ClassLoadRestriction; import org.bench4q.agent.helper.ClassLoadRestriction;
import org.bench4q.agent.share.DealWithLog; import org.bench4q.agent.share.DealWithLog;
import org.jdom.input.SAXBuilder;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -20,21 +19,11 @@ public class PluginManager {
private static final String PLUGIN_PACKAGE_NAME = "org.bench4q.agent.plugin"; private static final String PLUGIN_PACKAGE_NAME = "org.bench4q.agent.plugin";
private ClassHelper classHelper; private ClassHelper classHelper;
private TypeConverter typeConverter; private TypeConverter typeConverter;
private SAXBuilder saxBuilder;
private Map<String, Class<?>> plugins; private Map<String, Class<?>> plugins;
private Logger logger = Logger.getLogger(PluginManager.class); private Logger logger = Logger.getLogger(PluginManager.class);
private SAXBuilder getSaxBuilder() {
return saxBuilder;
}
private void setSaxBuilder(SAXBuilder saxBuilder) {
this.saxBuilder = saxBuilder;
}
@Autowired @Autowired
public PluginManager(ClassHelper classHelper, TypeConverter typeConverter) { public PluginManager(ClassHelper classHelper, TypeConverter typeConverter) {
this.setSaxBuilder(new SAXBuilder());
this.setClassHelper(classHelper); this.setClassHelper(classHelper);
this.setTypeConverter(typeConverter); this.setTypeConverter(typeConverter);
this.setPlugins(this.getClassHelper().loadClasses(PLUGIN_PACKAGE_NAME, this.setPlugins(this.getClassHelper().loadClasses(PLUGIN_PACKAGE_NAME,

View File

@ -2,5 +2,4 @@ package org.bench4q.share.models.master.plugin;
public enum ParamTypeEnum { public enum ParamTypeEnum {
Field, MultiField, CheckBox, Table Field, MultiField, CheckBox, Table
} }

View File

@ -0,0 +1,35 @@
package org.bench4q.share.models.master.plugin;
import java.util.List;
public class PluginInfoModel {
public static abstract class Type {
}
public static class Field extends Type {
private String size;
private String text;
}
public static class NField extends Type {
}
public static class Table extends Type {
private String column;
}
public static class Choice extends Type {
}
public static class CheckBox extends Type {
private List<Choice> choices;
}
public static class ParameterInfoModel {
private String name;
private String label;
private Type type;
}
}

Binary file not shown.