public void onDispose() { try { processor.setPolling(Integer.parseInt(interval.getText()), Double.parseDouble(backoff.getText()), Integer .parseInt(intervalmax.getText())); } catch (NumberFormatException nfe) { JOptionPane.showMessageDialog(null, "Fields must be valid numbers!\n" + nfe.getMessage(), "Exception!", JOptionPane.ERROR_MESSAGE); } }
public void actionPerformed(ActionEvent e) { try { processor.setPolling(Integer.parseInt(interval .getText()), Double.parseDouble(backoff .getText()), Integer.parseInt(intervalmax .getText())); } catch (NumberFormatException nfe) { JOptionPane.showMessageDialog(null, "Fields must be valid numbers!\n" + nfe.getMessage(), "Exception!", JOptionPane.ERROR_MESSAGE); interval.setText(processor.getPollingInterval() + ""); intervalmax.setText(processor.getPollingIntervalMax() + ""); backoff.setText(processor.getPollingBackoff() + ""); } } });
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; }