diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnEnabled.java b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnEnabled.java index 8d7d6b3376..1536decb80 100644 --- a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnEnabled.java +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnEnabled.java @@ -24,10 +24,15 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** + *

* Marker annotation a {@link org.apache.nifi.processor.Processor Processor}, * {@link org.apache.nifi.controller.ControllerService ControllerService} or * {@link org.apache.nifi.reporting.ReportingTask ReportingTask} - * can use to indicate a method should be called whenever the component is enabled. + * can use to indicate a method should be called whenever the component is enabled. + * Any method that has this annotation will be called every time a user enables the component. + * Additionally, each time that NiFi is restarted, if NiFi is configured to "auto-resume state" + * and the component is enabled (whether stopped or running), the method will be invoked. + *

* *

* Methods using this annotation must take either 0 arguments or a single argument. diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnScheduled.java b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnScheduled.java index a0703fa50e..c012bd728b 100644 --- a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnScheduled.java +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnScheduled.java @@ -24,11 +24,15 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** + *

* Marker annotation a {@link org.apache.nifi.processor.Processor Processor} or * {@link org.apache.nifi.reporting.ReportingTask ReportingTask} implementation * can use to indicate a method should be called whenever the component is scheduled * to run. This will be called before any call to 'onTrigger' and will be called once each time - * a Processor or Reporting Task is scheduled to run. + * a Processor or Reporting Task is scheduled to run. This occurs in one of two ways: either + * a user clicks to schedule the component to run, or NiFi is restarted with the "auto-resume state" + * configuration set to true (the default value) and the component is already running. + *

* *

* Methods using this annotation must take either 0 arguments or a single argument.