/** * Execute one single {@link ExecutionStage} */ private void executeSingleStage(boolean isBreakpointsDisabled, StageActivator stageActivator) { // Check if #breakpoint permits the execution. if (!isBreakpointsDisabled && this.suspendIfBreakpointRequest(stageActivator)) { return; } // Otherwise, execute the stage. this.execute(stageActivator); // Try to activate the successor stages. this.tryToActivateSuccessors(stageActivator); // We can now dispose the stageActivator that collected the input ChannelInstances. stageActivator.dispose(); // Dispose obsolete ChannelInstances. final Iterator<Map.Entry<Channel, ChannelInstance>> iterator = this.channelInstances.entrySet().iterator(); while (iterator.hasNext()) { final Map.Entry<Channel, ChannelInstance> channelInstanceEntry = iterator.next(); final ChannelInstance channelInstance = channelInstanceEntry.getValue(); // If this is instance is the only one to still use this ChannelInstance, discard it. if (channelInstance.getNumReferences() == 1) { channelInstance.noteDiscardedReference(true); iterator.remove(); } } }
if (channelInstance.getNumReferences() == 1) { channelInstance.noteDiscardedReference(true); iterator.remove();