/** * Set up a consumer {@link ExecutionTask} for this instance. * * @param consumer the new consumer * @param inputIndex the input index for this instance into the consumer */ public void addConsumer(ExecutionTask consumer, int inputIndex) { if (!this.consumers.contains(consumer)) { assert this.isReusable() || this.consumers.isEmpty() : String.format("Cannot add %s as consumer of non-reusable %s, there is already %s.", consumer, this, this.consumers); this.consumers.add(consumer); consumer.setInputChannel(inputIndex, this); } }