/** * This method receives incoming objects from the filter's input port. Every object will be printed into a stream * (based on the configuration) before the filter sends it to the output port. * * @param object * The new object. */ @Override protected void execute(final Object object) { if (this.active) { final StringBuilder sb = new StringBuilder(128).append(this.getId()).append('(') .append(object.getClass().getSimpleName()).append(") ").append(object.toString()); final String record = sb.toString(); if (this.printStream != null) { this.printStream.println(record); } else { this.logger.info(record); } } this.outputPort.send(object); }
private void executeAnalysis(final File tempFile, final boolean append, final List<Integer> objectsToWrite) { final TeeFilter teeFilter = new TeeFilter(tempFile.getAbsolutePath(), null, append); StageTester.test(teeFilter).and().send(objectsToWrite).to(teeFilter.getInputPort()).start(); }