/** * This method is the input port of the filter receiving incoming objects. 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. */ @InputPort(name = INPUT_PORT_NAME_EVENTS, description = "Receives incoming objects to be logged and forwarded", eventTypes = { Object.class }) public final void inputEvent(final Object object) { if (this.active) { final StringBuilder sb = new StringBuilder(128); sb.append(this.getName()).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); } } super.deliver(OUTPUT_PORT_NAME_RELAYED_EVENTS, object); } }
/** * This method is the input port of the filter receiving incoming objects. 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. */ @InputPort(name = INPUT_PORT_NAME_EVENTS, description = "Receives incoming objects to be logged and forwarded", eventTypes = { Object.class }) public final void inputEvent(final Object object) { if (this.active) { final StringBuilder sb = new StringBuilder(128); sb.append(this.getName()); sb.append('(').append(object.getClass().getSimpleName()).append(") ").append(object.toString()); final String record = sb.toString(); if (this.printStream != null) { this.printStream.println(record); } else { this.log.info(record); } } super.deliver(OUTPUT_PORT_NAME_RELAYED_EVENTS, object); } }