Skip to content

Commit

Permalink
Specify 'manualPush' in constructor instead of setter.
Browse files Browse the repository at this point in the history
Signed-off-by: Squareys <[email protected]>
  • Loading branch information
Squareys committed Sep 12, 2016
1 parent feeafa9 commit 2bd9815
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class DefaultNodeModule implements NodeModule {

private final Map<ModuleItem<?>, DataType> outputMapping;

private final NodeModuleOutputChangedListener outputListener;
private NodeModuleOutputChangedListener outputListener;

private final LogService logService;

Expand Down Expand Up @@ -78,7 +78,7 @@ public DefaultNodeModule(final Context context, final ModuleInfo info,
this.inputMapping = inputMapping;
this.outputMapping = outputMapping;
this.module = ms.createModule(info);
this.outputListener = new NodeModuleOutputChangedListener();
this.outputListener = new NodeModuleOutputChangedListener(false);
this.logService = new KNIMELogService(logger);

preProcess(params);
Expand Down Expand Up @@ -109,9 +109,9 @@ private void preProcess(final Map<String, Object> params) {
/* MultiOutputListener */
final String name = item.getName();

outputListener = new NodeModuleOutputChangedListener(true);
module.setInput(name, outputListener);
module.resolveInput(name);
outputListener.enableManualPush(true);
} else if (LogService.class.equals(item.getType())) {
/* LogService */
final String name = item.getName();
Expand Down Expand Up @@ -158,7 +158,18 @@ private class NodeModuleOutputChangedListener
private CellOutput output;

/* true if the modules handles pushes itself, false otherwise */
private boolean manualPush = false;
private final boolean manualPush;

/**
* Constructor.
*
* @param manualPush
* if <code>true</code>, signals that the module handles
* pushing rows.
*/
public NodeModuleOutputChangedListener(final boolean manualPush) {
this.manualPush = manualPush;
}

@Override
public void notifyListener() {
Expand Down Expand Up @@ -213,16 +224,5 @@ public void flush() {
notifyListener();
}
}

/**
* Enable/Disable manual push.
*
* @param b
* if <code>true</code>, signals that the module handles
* pushing rows.
*/
public void enableManualPush(final boolean b) {
manualPush = b;
}
}
}

0 comments on commit 2bd9815

Please sign in to comment.