public Processor loadProcessorFromXML(Element processorNode, ScuflModel model, String name) throws ProcessorCreationException, DuplicateProcessorNameException, XScuflFormatException { Element soaplab = processorNode .getChild("soaplabwsdl", XScufl.XScuflNS); String endpoint = soaplab.getTextTrim(); try { new URL(endpoint); } catch (MalformedURLException mue) { throw new XScuflFormatException( "The url specified for the soaplab endpoint for '" + name + "' was invalid : " + mue); } SoaplabProcessor theProcessor = new SoaplabProcessor(model, name, endpoint); // Set the polling properties if they're defined, or just use the // defaults // if not. theProcessor.setPolling(Integer.parseInt(soaplab.getAttributeValue( "interval", "0")), Double.parseDouble(soaplab .getAttributeValue("backoff", "1.0")), Integer.parseInt(soaplab .getAttributeValue("intervalmax", "0"))); return theProcessor; }
public static void main(String[] args) throws Exception { System.out.println("Starting test : SoaplabProcessorCreation"); // Create a new ScuflModel ScuflModel model = new ScuflModel(); // Register a listener to print to stdout model.addListener(new ScuflModelEventPrinter(null)); // Attempt to create a new SoaplabProcessor model.addProcessor(new SoaplabProcessor(model, "my_processor", "http://industry.ebi.ac.uk/soap/soaplab/nucleic_gene_finding::getorf")); System.out.println("Finished test : SoaplabProcessorCreation"); }