Skip to content

Commit

Permalink
[FIXED JENKINS-30055] The listener which closes flow graph log files …
Browse files Browse the repository at this point in the history
…must receive events immediately, and unregister itself.

Originally-Committed-As: 1084a9bd2495989bb78e013c08c8348542e7955f
  • Loading branch information
jglick committed Sep 25, 2015
1 parent c47bb9f commit f697e0c
Showing 1 changed file with 19 additions and 1 deletion.
Expand Up @@ -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.
Expand Down

0 comments on commit f697e0c

Please sign in to comment.