Add support for onUnscheduled method

Add support for onUnscheduled method1

Add support for onUnscheduled method

Add support for onUnscheduled method
This commit is contained in:
wagggz 2019-08-10 12:17:53 -04:00 committed by Pierre Villard
parent 23c8234586
commit 48d4e6d14c
No known key found for this signature in database
GPG Key ID: BEE1599F0726E9CD
1 changed files with 9 additions and 0 deletions

View File

@ -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) {