@Test(expected = IOException.class) public void execute_invalid_source() throws IOException { MockDriverFactory factory = new MockDriverFactory(); ProcessScript<String> script = new ProcessScript<>( "testing", "plain", String.class, driver("source"), driver("drain")); provider.execute(factory, script); }
@Override public <T> void execute(DriverFactory drivers, ProcessScript<T> script) throws IOException { WGLOG.info("I05000", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName()); long start = System.currentTimeMillis(); long count = 0; ExceptionHolder<IOException> exceptions = new ExceptionHolder<>(); try (SafeCloser<SourceDriver<T>> source = new SafeCloser<SourceDriver<T>>() { @Override protected void handle(IOException exception) throws IOException { exceptions.record(exception); WGLOG.error(exception, "E05002", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName()); } }; SafeCloser<DrainDriver<T>> drain = new SafeCloser<DrainDriver<T>>() { @Override protected void handle(IOException exception) throws IOException { exceptions.record(exception); WGLOG.error(exception, "E05003", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName()); } }) { LOG.debug("Creating source driver for resource \"{}\" in process \"{}\"", script.getSourceScript().getResourceName(), script.getName()); source.set(drivers.createSource(script)); LOG.debug("Creating drain driver for resource \"{}\" in process \"{}\"", script.getDrainScript().getResourceName(), script.getName()); drain.set(drivers.createDrain(script)); performPrepare(script, source.get(), drain.get()); count = performTransfer(script, source.get(), drain.get()); exceptions.throwRecorded(); WGLOG.info("I05001", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName(), count); } finally { long end = System.currentTimeMillis(); WGLOG.info("I05999", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName(), count, end - start); } }
BasicProcessProvider extends ProcessProvider { @Override public <T> void execute(DriverFactory drivers, ProcessScript<T> script) throws IOException { WGLOG.info("I05000", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName()); long start = System.currentTimeMillis(); long count = 0; ExceptionHolder<IOException> exceptions = new ExceptionHolder<>(); try (SafeCloser<SourceDriver<T>> source = new SafeCloser<SourceDriver<T>>() { @Override protected void handle(IOException exception) throws IOException { exceptions.record(exception); WGLOG.error(exception, "E05002", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName()); } }; SafeCloser<DrainDriver<T>> drain = new SafeCloser<DrainDriver<T>>() { @Override protected void handle(IOException exception) throws IOException { exceptions.record(exception); WGLOG.error(exception, "E05003", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName()); } }) { LOG.debug("Creating source driver for resource \"{}\" in process \"{}\"", script.getSourceScript().getResourceName(), script.getName()); source.set(drivers.createSource(script)); LOG.debug("Creating drain driver for resource \"{}\" in process \"{}\"", script.getDrainScript().getResourceName(), script.getName()); drain.set(drivers.createDrain(script)); performPrepare(script, source.get(), drain.get()); count = performTransfer(script, source.get(), drain.get()); exceptions.throwRecorded(); WGLOG.info("I05001", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName(), count); } finally { long end = System.currentTimeMillis(); WGLOG.info("I05999", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName(), count, end - start); } } }
BasicProcessProvider extends ProcessProvider { @Override public <T> void execute(DriverFactory drivers, ProcessScript<T> script) throws IOException { WGLOG.info("I05000", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName()); long start = System.currentTimeMillis(); long count = 0; ExceptionHolder<IOException> exceptions = new ExceptionHolder<>(); try (SafeCloser<SourceDriver<T>> source = new SafeCloser<SourceDriver<T>>() { @Override protected void handle(IOException exception) throws IOException { exceptions.record(exception); WGLOG.error(exception, "E05002", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName()); } }; SafeCloser<DrainDriver<T>> drain = new SafeCloser<DrainDriver<T>>() { @Override protected void handle(IOException exception) throws IOException { exceptions.record(exception); WGLOG.error(exception, "E05003", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName()); } }) { LOG.debug("Creating source driver for resource \"{}\" in process \"{}\"", script.getSourceScript().getResourceName(), script.getName()); source.set(drivers.createSource(script)); LOG.debug("Creating drain driver for resource \"{}\" in process \"{}\"", script.getDrainScript().getResourceName(), script.getName()); drain.set(drivers.createDrain(script)); performPrepare(script, source.get(), drain.get()); count = performTransfer(script, source.get(), drain.get()); exceptions.throwRecorded(); WGLOG.info("I05001", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName(), count); } finally { long end = System.currentTimeMillis(); WGLOG.info("I05999", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName(), count, end - start); } }  }
BasicProcessProvider extends ProcessProvider { @Override public <T> void execute(DriverFactory drivers, ProcessScript<T> script) throws IOException { WGLOG.info("I05000", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName()); long start = System.currentTimeMillis(); long count = 0; ExceptionHolder<IOException> exceptions = new ExceptionHolder<>(); try (SafeCloser<SourceDriver<T>> source = new SafeCloser<SourceDriver<T>>() { @Override protected void handle(IOException exception) throws IOException { exceptions.record(exception); WGLOG.error(exception, "E05002", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName()); } }; SafeCloser<DrainDriver<T>> drain = new SafeCloser<DrainDriver<T>>() { @Override protected void handle(IOException exception) throws IOException { exceptions.record(exception); WGLOG.error(exception, "E05003", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName()); } }) { LOG.debug("Creating source driver for resource \"{}\" in process \"{}\"", script.getSourceScript().getResourceName(), script.getName()); source.set(drivers.createSource(script)); LOG.debug("Creating drain driver for resource \"{}\" in process \"{}\"", script.getDrainScript().getResourceName(), script.getName()); drain.set(drivers.createDrain(script)); performPrepare(script, source.get(), drain.get()); count = performTransfer(script, source.get(), drain.get()); exceptions.throwRecorded(); WGLOG.info("I05001", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName(), count); } finally { long end = System.currentTimeMillis(); WGLOG.info("I05999", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName(), count, end - start); } }  @Override void execute(DriverFactory drivers, ProcessScript<T> script); }
BasicProcessProvider extends ProcessProvider { @Override public <T> void execute(DriverFactory drivers, ProcessScript<T> script) throws IOException { WGLOG.info("I05000", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName()); long start = System.currentTimeMillis(); long count = 0; ExceptionHolder<IOException> exceptions = new ExceptionHolder<>(); try (SafeCloser<SourceDriver<T>> source = new SafeCloser<SourceDriver<T>>() { @Override protected void handle(IOException exception) throws IOException { exceptions.record(exception); WGLOG.error(exception, "E05002", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName()); } }; SafeCloser<DrainDriver<T>> drain = new SafeCloser<DrainDriver<T>>() { @Override protected void handle(IOException exception) throws IOException { exceptions.record(exception); WGLOG.error(exception, "E05003", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName()); } }) { LOG.debug("Creating source driver for resource \"{}\" in process \"{}\"", script.getSourceScript().getResourceName(), script.getName()); source.set(drivers.createSource(script)); LOG.debug("Creating drain driver for resource \"{}\" in process \"{}\"", script.getDrainScript().getResourceName(), script.getName()); drain.set(drivers.createDrain(script)); performPrepare(script, source.get(), drain.get()); count = performTransfer(script, source.get(), drain.get()); exceptions.throwRecorded(); WGLOG.info("I05001", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName(), count); } finally { long end = System.currentTimeMillis(); WGLOG.info("I05999", script.getName(), script.getSourceScript().getResourceName(), script.getDrainScript().getResourceName(), count, end - start); } }  @Override void execute(DriverFactory drivers, ProcessScript<T> script);  }