Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,25 @@
*/
void onNewHead(FlowNode node);

/**
* Controls the order in which listeners are notified of new nodes.
* Like {@link Extension#ordinal}, but can also be used for instantiated listeners passed to
* {@link FlowExecution#addListener(GraphListener)}.
* <p>
* The default implementation returns {@code 1000} for listeners that are not annotated with {@link Extension}.
* For listeners annotated with {@link Extension}, the default value matches {@link Extension#ordinal}.
*
* @see Extension#ordinal
*/
default double ordinal() {
Class<?> listener = getClass();
Extension extension = listener.getAnnotation(Extension.class);
if (extension != null) {
return extension.ordinal();
}
return 1000;

Check warning on line 62 in src/main/java/org/jenkinsci/plugins/workflow/flow/GraphListener.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 57-62 are not covered by tests
}

/**
* Listener which should be notified of events immediately as they occur.
* You must be very careful not to acquire locks or block.
Expand Down
Loading