ResourceSpecification resources) {
this(null, name, description, dataSets, properties, resources);
}
public DefaultProcedureSpecification(Procedure procedure, int instances) {
ProcedureSpecification configureSpec = procedure.configure();
Set<String> dataSets = Sets.newHashSet(configureSpec.getDataSets());
Map<String, String> properties = Maps.newHashMap(configureSpec.getProperties());
Reflections.visit(procedure, TypeToken.of(procedure.getClass()),
new PropertyFieldExtractor(properties),
new DataSetFieldExtractor(dataSets));
this.className = procedure.getClass().getName();
this.name = configureSpec.getName();
this.description = configureSpec.getDescription();
this.dataSets = ImmutableSet.copyOf(dataSets);
this.properties = ImmutableMap.copyOf(properties);
this.resources = configureSpec.getResources();
this.instances = instances;
}