@Documented @Target(value=METHOD) @Retention(value=RUNTIME) @Inherited public @interface OnStopped
Marker annotation a Processor
or
ReportingTask
implementation
can use to indicate that a method should be called whenever the component is
no longer scheduled to run. Methods marked with this annotation will be
invoked each time the component is stopped and will be invoked only after the
last thread has returned from the onTrigger
method.
This means that the thread executing in this method will be the only thread executing in any part of the Processor. However, since other threads may later execute other parts of the code, member variables must still be protected appropriately. However, access to multiple variables need not be atomic.
To indicate that a method should be called immediately when a component is no
longer scheduled to run (as opposed to after all threads have returned from
the onTrigger
method), see the OnUnscheduled
annotation.
Methods with this annotation are permitted to take either 0 or 1 argument. If
an argument is used, it must be of type ConfigurationContext
if the
component is a ReportingTask or of type ProcessContext
if the
component is a Processor.
Implementation Guidelines:
onTrigger
method instead.InterruptedException
.Copyright © 2022 Apache NiFi Project. All rights reserved.