You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by pv...@apache.org on 2020/01/16 12:11:49 UTC
[nifi] 01/02: Add support for onUnscheduled method
This is an automated email from the ASF dual-hosted git repository.
pvillard pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git
commit 48d4e6d14c6d835e091d7609930b7eec5b977db3
Author: wagggz <mi...@gmail.com>
AuthorDate: Sat Aug 10 12:17:53 2019 -0400
Add support for onUnscheduled method
Add support for onUnscheduled method1
Add support for onUnscheduled method
Add support for onUnscheduled method
---
.../org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java b/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
index 5516aeb..627ec2c 100644
--- a/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
+++ b/nifi-nar-bundles/nifi-groovyx-bundle/nifi-groovyx-processors/src/main/java/org/apache/nifi/processors/groovyx/ExecuteGroovyScript.java
@@ -27,6 +27,7 @@ import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.SeeAlso;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.annotation.lifecycle.OnScheduled;
+import org.apache.nifi.annotation.lifecycle.OnUnscheduled;
import org.apache.nifi.annotation.lifecycle.OnStopped;
import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.components.RequiredPermission;
@@ -270,6 +271,14 @@ public class ExecuteGroovyScript extends AbstractProcessor {
throw new ProcessException("onStart failed: " + t, t);
}
}
+ @OnUnscheduled
+ public void onUnscheduled(final ProcessContext context) {
+ try {
+ callScriptStatic("onUnscheduled", context);
+ } catch (Throwable t) {
+ throw new ProcessException("onUnscheduled failed: " + t, t);
+ }
+ }
@OnStopped
public void onStopped(final ProcessContext context) {