Class NodeCleanUpCallback

java.lang.Object
org.knime.core.webui.node.util.NodeCleanUpCallback
All Implemented Interfaces:
org.knime.core.node.workflow.NodeStateChangeListener, org.knime.core.node.workflow.WorkflowListener

public final class NodeCleanUpCallback extends Object implements org.knime.core.node.workflow.WorkflowListener, org.knime.core.node.workflow.NodeStateChangeListener
Helper to clean-up after a node removal, workflow disposal or (optionally) node state change. Once a clean-up has been triggered, all the registered listeners (on the node and the workflow) are removed which renders the NodeCleanUpCallback-instance useless afterwards.
Author:
Martin Horn, KNIME GmbH, Konstanz, Germany
  • Method Details

    • workflowChanged

      public void workflowChanged(org.knime.core.node.workflow.WorkflowEvent e)
      Specified by:
      workflowChanged in interface org.knime.core.node.workflow.WorkflowListener
    • builder

      public static NodeCleanUpCallback.Builder builder(org.knime.core.node.workflow.NodeContainer nc, Runnable onCleanUp)
      Parameters:
      nc - the node to watch
      onCleanUp - the callback to call when the node is being disposed.
      Returns:
      a new builder instance
    • stateChanged

      public void stateChanged(org.knime.core.node.workflow.NodeStateEvent state)
      Specified by:
      stateChanged in interface org.knime.core.node.workflow.NodeStateChangeListener