/** * Add tag library. * * @param classes * tag library classes. * @return this */ public Paxml addTagLibrary(Class<? extends ITagLibrary>... classes) { for (Class<? extends ITagLibrary> clazz : classes) { ITagLibrary lib = ReflectUtils.createObject(clazz); parser.addTagLibrary(lib, true); } return this; }
/** * Add tag library. * * @param classes * tag library classes. * @return this */ public Paxml addTagLibrary(Class<? extends ITagLibrary>... classes) { for (Class<? extends ITagLibrary> clazz : classes) { ITagLibrary lib = ReflectUtils.createObject(clazz); // let later libs overwrite earlier ones, the system default lib is // the earliest one parser.addTagLibrary(lib, false); } return this; }
} else if (line.startsWith(CMD_ADD_TAG_LIBRARY)) { String cls = StringUtils.substringAfter(line, " ").trim(); paxml.getParser().addTagLibrary((ITagLibrary) ReflectUtils.createObject(cls, null), false); println("Tag library added: " + cls); } else if (line.equals(CMD_QUIT)) {
private Plan processPlan(OMElement root, Properties props) { final Paxml paxml = new Paxml(0); paxml.addStaticConfig(model.getConfig()); // add the plan tag lib temporarily paxml.getParser().addTagLibrary(new PlanTagLibrary(), false); final PaxmlResource planFileResource; try { planFileResource = PaxmlResource.createFromPath(planFile.getURI().toString()); } catch (IOException e) { throw new PaxmlRuntimeException(e); } // add resource for execution paxml.addResources(planFileResource); IEntity entity = paxml.getParser().parseXml(root, planFileResource, null); if (entity == null) { throw new PaxmlRuntimeException("Internal error: should not be null!"); } props.put(LaunchModel.class, model); paxml.execute(entity, System.getProperties(), props); Plan plan = (Plan) entity; return plan; }
private Plan processPlan(OMElement root, Properties props) { final long pid = LaunchModel.generateNextPid(); model.setPlanProcessId(pid); final Paxml paxml = new Paxml(pid, PaxmlUtils.getNextExecutionId()); paxml.addStaticConfig(model.getConfig()); // add the plan tag lib temporarily paxml.getParser().addTagLibrary(new PlanTagLibrary(), false); final PaxmlResource planFileResource; try { planFileResource = PaxmlResource.createFromPath(planFile.getURI().toString()); } catch (IOException e) { throw new PaxmlRuntimeException(e); } // add resource for execution paxml.addResources(planFileResource); IEntity entity = paxml.getParser().parseXml(root, planFileResource, null); if (entity == null) { throw new PaxmlRuntimeException("Internal error: should not be null!"); } props.put(LaunchModel.class, model); paxml.execute(entity, System.getProperties(), props); Plan plan = (Plan) entity; return plan; }
Paxml paxml = new Paxml(LaunchModel.generateNextPid(), execId); paxml.addStaticConfig(config); paxml.getParser().addTagLibrary(new PlanTagLibrary(), false);