Skip to content
Permalink
Browse files
[FIXED JENKINS-30055] The listener which closes flow graph log files …
…must receive events immediately, and unregister itself.

Originally-Committed-As: 1084a9bd2495989bb78e013c08c8348542e7955f
  • Loading branch information
jglick committed Sep 25, 2015
1 parent c47bb9f commit f697e0cfd884f7106cb7066364b2eb372206c6a7
Showing with 19 additions and 1 deletion.
  1. +19 −1 api/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecution.java
@@ -158,7 +158,25 @@ public String getUrl() throws IOException {
*/
public abstract void interrupt(Result r, CauseOfInterruption... causes) throws IOException, InterruptedException;

public abstract void addListener(GraphListener listener);
@Deprecated
public void addListener(GraphListener listener) {
addListener(listener, false);
}

/**
* Add a listener to changes in the flow graph structure.
* @param listener a listener to add
* @param synchronous true to receive events immediately as they occur (you must be very careful not to acquire locks or block); false to receive notification as soon as possible
*/
public /*abstract*/ void addListener(GraphListener listener, boolean synchronous) {
if (Util.isOverridden(FlowExecution.class, getClass(), "addListener", GraphListener.class) && !synchronous) {
addListener(listener);
} else {
throw new AbstractMethodError("you must override the new overload of addListener");
}
}

public /*abstract*/ void removeListener(GraphListener listener) {}

/**
* Checks whether this flow execution has finished executing completely.

0 comments on commit f697e0c

Please sign in to comment.