NIFI-6: Rebased from develop and moved new artifacts as appropriate
Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/0f310325 Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/0f310325 Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/0f310325 Branch: refs/heads/NIFI-6 Commit: 0f310325a3dde4a6774d2543f2dc11b3df0d8406 Parents: 29b3ad8 Author: Mark Payne <marka...@hotmail.com> Authored: Fri Jan 16 12:12:27 2015 -0500 Committer: Mark Payne <marka...@hotmail.com> Committed: Fri Jan 16 12:12:27 2015 -0500 ---------------------------------------------------------------------- .../nifi/annotation/behavior/EventDriven.java | 49 ----------- .../annotation/behavior/SideEffectFree.java | 47 ----------- .../annotation/behavior/SupportsBatching.java | 52 ------------ .../annotation/behavior/TriggerSerially.java | 40 --------- .../TriggerWhenAnyDestinationAvailable.java | 42 ---------- .../annotation/behavior/TriggerWhenEmpty.java | 42 ---------- .../documentation/CapabilityDescription.java | 41 ---------- .../nifi/annotation/documentation/Tags.java | 46 ----------- .../nifi/annotation/lifecycle/OnAdded.java | 44 ---------- .../nifi/annotation/lifecycle/OnRemoved.java | 43 ---------- .../nifi/annotation/lifecycle/OnScheduled.java | 58 ------------- .../nifi/annotation/lifecycle/OnShutdown.java | 42 ---------- .../nifi/annotation/lifecycle/OnStopped.java | 59 -------------- .../annotation/lifecycle/OnUnscheduled.java | 44 ---------- .../util/TestStandardProcessorTestRunner.java | 86 -------------------- .../nifi/annotation/behavior/EventDriven.java | 49 +++++++++++ .../annotation/behavior/SideEffectFree.java | 47 +++++++++++ .../annotation/behavior/SupportsBatching.java | 52 ++++++++++++ .../annotation/behavior/TriggerSerially.java | 40 +++++++++ .../TriggerWhenAnyDestinationAvailable.java | 42 ++++++++++ .../annotation/behavior/TriggerWhenEmpty.java | 42 ++++++++++ .../documentation/CapabilityDescription.java | 41 ++++++++++ .../nifi/annotation/documentation/Tags.java | 46 +++++++++++ .../nifi/annotation/lifecycle/OnAdded.java | 44 ++++++++++ .../nifi/annotation/lifecycle/OnRemoved.java | 43 ++++++++++ .../nifi/annotation/lifecycle/OnScheduled.java | 58 +++++++++++++ .../nifi/annotation/lifecycle/OnShutdown.java | 42 ++++++++++ .../nifi/annotation/lifecycle/OnStopped.java | 59 ++++++++++++++ .../annotation/lifecycle/OnUnscheduled.java | 44 ++++++++++ .../util/TestStandardProcessorTestRunner.java | 86 ++++++++++++++++++++ 30 files changed, 735 insertions(+), 735 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/EventDriven.java ---------------------------------------------------------------------- diff --git a/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/EventDriven.java b/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/EventDriven.java deleted file mode 100644 index 279a49e..0000000 --- a/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/EventDriven.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.annotation.behavior; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * <p> - * Annotation that may be placed on a Processor that indicates to the framework - * that the Processor is eligible to be scheduled to run based on the occurrence - * of an "Event" (e.g., when a FlowFile is enqueued in an incoming Connection), - * rather than being triggered periodically. - * </p> - * - * <p> - * This Annotation should not be used in conjunction with - * {@link TriggerSerially} or {@link TriggerWhenEmpty}. If this Annotation is - * used with either of these other Annotations, the Processor will not be - * eligible to be scheduled in Event-Driven mode. - * </p> - * - * @author none - */ -@Documented -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -@Inherited -public @interface EventDriven { - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/SideEffectFree.java ---------------------------------------------------------------------- diff --git a/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/SideEffectFree.java b/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/SideEffectFree.java deleted file mode 100644 index f32acc3..0000000 --- a/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/SideEffectFree.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.annotation.behavior; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marker annotation a {@link org.apache.nifi.processor.Processor Processor} - * implementation can use to indicate that its - * operations on FlowFiles can be safely repeated across process sessions. If a - * processor has this annotation and it allows the framework to manage session - * commit and rollback then the framework may elect to cascade a - * {@link org.apache.nifi.processor.ProcessSession ProcessSession} given to this - * processor's onTrigger method to the - * onTrigger method of another processor. It can do this knowing that if - * something fails along a series of processors using this same session that it - * can all be safely rolled back without any ill effects on external services - * which could not be rolled back and thus all the processes could be safely - * repeated (implied idempotent behavior). - * - * @author none - */ -@Documented -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -@Inherited -public @interface SideEffectFree { -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/SupportsBatching.java ---------------------------------------------------------------------- diff --git a/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/SupportsBatching.java b/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/SupportsBatching.java deleted file mode 100644 index f5fd61f..0000000 --- a/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/SupportsBatching.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.annotation.behavior; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marker annotation a Processor implementation can use to indicate that users - * should be able to supply a Batch Duration for the Processor. If a Processor - * uses this annotation, it is allowing the Framework to batch - * {@link nifi.processor.ProcessSession ProcessSession}s' commits, as well as - * allowing the Framework to return the same ProcessSession multiple times from - * subsequent calls to - * {@link nifi.processor.ProcessSessionFactory ProcessSessionFactory}. - * {@link nifi.processor.ProcessSessionFactory#createSession() createSession()}. - * - * When this Annotation is used, it is important to note that calls to - * {@link nifi.processor.ProcessSession#commit() ProcessSession.commit()} may - * not provide a guarantee that the data has been safely stored in NiFi's - * Content Repository or FlowFile Repository. Therefore, it is not appropriate, - * for instance, to use this annotation if the Processor will call - * ProcessSession.commit() to ensure data is persisted before deleting the data - * from a remote source. - * - * @author none - */ -@Documented -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -@Inherited -public @interface SupportsBatching { - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerSerially.java ---------------------------------------------------------------------- diff --git a/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerSerially.java b/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerSerially.java deleted file mode 100644 index 7bf7d0b..0000000 --- a/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerSerially.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.annotation.behavior; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marker annotation a {@link org.apache.nifi.processor.Processor Processor} - * implementation can use to indicate that the - * Processor is not safe for concurrent execution of its onTrigger() - * method. By default, Processors are assumed to be safe for concurrent - * execution. - * - * @author none - */ -@Documented -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -@Inherited -public @interface TriggerSerially { -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerWhenAnyDestinationAvailable.java ---------------------------------------------------------------------- diff --git a/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerWhenAnyDestinationAvailable.java b/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerWhenAnyDestinationAvailable.java deleted file mode 100644 index 803aa2f..0000000 --- a/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerWhenAnyDestinationAvailable.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.annotation.behavior; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marker annotation a {@link org.apache.nifi.processor.Processor Processor} - * implementation can use to indicate that the - * Processor is to be triggered if any of its destinations has available space - * for incoming FlowFiles. By default, Processors are triggered only when all - * destinations report that they have available space (i.e., none of the outgoing - * Connections is full). - * - * @author none - */ -@Documented -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -@Inherited -public @interface TriggerWhenAnyDestinationAvailable { - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerWhenEmpty.java ---------------------------------------------------------------------- diff --git a/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerWhenEmpty.java b/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerWhenEmpty.java deleted file mode 100644 index fed9b34..0000000 --- a/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerWhenEmpty.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.annotation.behavior; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marker annotation a {@link org.apache.nifi.processor.Processor Processor} - * implementation can use to indicate that the - * Processor should still be triggered even when it has no data in its work - * queue. By default, Processors which have no non-self incoming edges will be - * triggered even if there is no work in its queue. However, Processors that - * have non-self incoming edges will only be triggered if they have work in - * their queue or they present this annotation. - * - * @author none - */ -@Documented -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -@Inherited -public @interface TriggerWhenEmpty { -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi-api/src/main/java/org/apache/nifi/annotation/documentation/CapabilityDescription.java ---------------------------------------------------------------------- diff --git a/nifi-api/src/main/java/org/apache/nifi/annotation/documentation/CapabilityDescription.java b/nifi-api/src/main/java/org/apache/nifi/annotation/documentation/CapabilityDescription.java deleted file mode 100644 index d69788a..0000000 --- a/nifi-api/src/main/java/org/apache/nifi/annotation/documentation/CapabilityDescription.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.annotation.documentation; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotation that may be placed on a {@link org.apache.nifi.processor.Processor Processor}, - * {@link org.apache.nifi.controller.ControllerService ControllerService}, or - * {@link org.apache.nifi.reporting.ReportingTask ReportingTask} allowing for a description to be - * provided. This description can be provided to a user in logs, UI, etc. - * - * @author none - */ -@Documented -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -@Inherited -public @interface CapabilityDescription { - - String value(); -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi-api/src/main/java/org/apache/nifi/annotation/documentation/Tags.java ---------------------------------------------------------------------- diff --git a/nifi-api/src/main/java/org/apache/nifi/annotation/documentation/Tags.java b/nifi-api/src/main/java/org/apache/nifi/annotation/documentation/Tags.java deleted file mode 100644 index 8bd8f9a..0000000 --- a/nifi-api/src/main/java/org/apache/nifi/annotation/documentation/Tags.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.annotation.documentation; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotation that can be applied to a {@link org.apache.nifi.processor.Processor Processor}, - * {@link org.apache.nifi.controller.ControllerService ControllerService}, or - * {@link org.apache.nifi.reporting.ReportingTask ReportingTask} in order to associate - * tags (keywords) with the component. These tags do not affect the component in - * any way but serve as additional documentation and can be used to sort/filter - * Processors. - * - * @author none - */ -@Documented -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -@Inherited -public @interface Tags { - - /** - * @return all tag values associated with the given processor - */ - public String[] value(); -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnAdded.java ---------------------------------------------------------------------- diff --git a/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnAdded.java b/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnAdded.java deleted file mode 100644 index acb7a4d..0000000 --- a/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnAdded.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.annotation.lifecycle; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -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} - * implementation can use to indicate a method - * should be called whenever the component is added to the flow. This method - * will be called once for the entire life of a component instance. - * - * If any method annotated with this annotation throws a Throwable, the component - * will not be added to the flow. - * - * @author none - */ -@Documented -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@Inherited -public @interface OnAdded { -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnRemoved.java ---------------------------------------------------------------------- diff --git a/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnRemoved.java b/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnRemoved.java deleted file mode 100644 index 696159f..0000000 --- a/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnRemoved.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.annotation.lifecycle; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -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} implementation - * can use to indicate a method should be called whenever the component is removed - * from the flow. This method will be called once for the entire life of a - * component instance. If the method throw any Throwable, that Throwable will be - * caught and logged but will not prevent subsequent methods with this annotation - * or removal of the component from the flow. - * - * @author none - */ -@Documented -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@Inherited -public @interface OnRemoved { -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnScheduled.java ---------------------------------------------------------------------- diff --git a/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnScheduled.java b/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnScheduled.java deleted file mode 100644 index 9dfd150..0000000 --- a/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnScheduled.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.annotation.lifecycle; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -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. - * - * <p> - * Methods using this annotation must take either 0 arguments or a single argument. - * </p> - * - * <p> - * If using 1 argument and the component using the annotation is a Processor, that argument must - * be of type {@link org.apache.nifi.processor.ProcessContext ProcessContext}. - * </p> - * - * <p> - * If using 1 argument and the component using the annotation is a Reporting Task, that argument must - * be of type {@link org.apache.nifi.reporting.ReportingContext ReportingContext}. - * </p> - * - * If any method annotated with this annotation throws any Throwable, the framework will wait a while - * and then attempt to invoke the method again. This will continue until the method succeeds, and the - * component will then be scheduled to run after this method return successfully. - * - * @author none - */ -@Documented -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@Inherited -public @interface OnScheduled { -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnShutdown.java ---------------------------------------------------------------------- diff --git a/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnShutdown.java b/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnShutdown.java deleted file mode 100644 index a4129e1..0000000 --- a/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnShutdown.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.annotation.lifecycle; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -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} implementation - * can use to indicate a method should be called whenever the flow is being shutdown. - * This will be called at most once for each component in a JVM lifetime. - * It is not, however, guaranteed that this method will be called on shutdown, as - * the service may be killed suddenly. - * - * @author none - */ -@Documented -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@Inherited -public @interface OnShutdown { -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnStopped.java ---------------------------------------------------------------------- diff --git a/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnStopped.java b/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnStopped.java deleted file mode 100644 index 4715253..0000000 --- a/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnStopped.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.annotation.lifecycle; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * <p> - * Marker annotation a {@link org.apache.nifi.processor.Processor Processor} or - * {@link org.apache.nifi.reporting.ReportingTask 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 <code>onTrigger</code> method. - * </p> - * - * <p> - * 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. - * </p> - * - * <p> - * 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 - * <code>onTrigger</code> method), see the {@link OnUnscheduled} annotation. - * </p> - * - * @author none - */ -@Documented -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@Inherited -public @interface OnStopped { - -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnUnscheduled.java ---------------------------------------------------------------------- diff --git a/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnUnscheduled.java b/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnUnscheduled.java deleted file mode 100644 index 68d0fe8..0000000 --- a/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnUnscheduled.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.annotation.lifecycle; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * <p> - * Marker annotation a {@link org.apache.nifi.processor.Processor Processor} or - * {@link org.apache.nifi.reporting.ReportingTask ReportingTask} - * should be called whenever the component is no longer scheduled to run. - * Methods marked with this annotation will be invoked each time the framework - * is notified to stop scheduling the component. This method is invoked as other - * threads are potentially running. To invoke a method after all threads have - * finished processing, see the {@link OnStopped} annotation. - * </p> - * - * @author none - */ -@Documented -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@Inherited -public @interface OnUnscheduled { -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java ---------------------------------------------------------------------- diff --git a/nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java b/nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java deleted file mode 100644 index 37bcf23..0000000 --- a/nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.util; - -import org.apache.nifi.processor.AbstractProcessor; -import org.apache.nifi.processor.ProcessContext; -import org.apache.nifi.processor.ProcessSession; -import org.apache.nifi.processor.exception.ProcessException; -import org.junit.Test; - -public class TestStandardProcessorTestRunner { - - @Test(expected=AssertionError.class) - public void testFailOnDeprecatedTypeAnnotation() { - new StandardProcessorTestRunner(new DeprecatedAnnotation()); - } - - @Test - public void testDoesNotFailOnNonDeprecatedTypeAnnotation() { - new StandardProcessorTestRunner(new NewAnnotation()); - } - - @Test(expected=AssertionError.class) - public void testFailOnDeprecatedMethodAnnotation() { - new StandardProcessorTestRunner(new DeprecatedMethodAnnotation()); - } - - @Test - public void testDoesNotFailOnNonDeprecatedMethodAnnotation() { - new StandardProcessorTestRunner(new NewMethodAnnotation()); - } - - - - @SuppressWarnings("deprecation") - @org.apache.nifi.processor.annotation.Tags({"deprecated"}) - private static class DeprecatedAnnotation extends AbstractProcessor { - @Override - public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException { - } - } - - @org.apache.nifi.annotation.documentation.Tags({"deprecated"}) - private static class NewAnnotation extends AbstractProcessor { - @Override - public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException { - } - } - - private static class NewMethodAnnotation extends AbstractProcessor { - @org.apache.nifi.annotation.lifecycle.OnScheduled - public void dummy() { - - } - - @Override - public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException { - } - } - - private static class DeprecatedMethodAnnotation extends AbstractProcessor { - @SuppressWarnings("deprecation") - @org.apache.nifi.processor.annotation.OnScheduled - public void dummy() { - - } - - @Override - public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException { - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/EventDriven.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/EventDriven.java b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/EventDriven.java new file mode 100644 index 0000000..279a49e --- /dev/null +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/EventDriven.java @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.annotation.behavior; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * <p> + * Annotation that may be placed on a Processor that indicates to the framework + * that the Processor is eligible to be scheduled to run based on the occurrence + * of an "Event" (e.g., when a FlowFile is enqueued in an incoming Connection), + * rather than being triggered periodically. + * </p> + * + * <p> + * This Annotation should not be used in conjunction with + * {@link TriggerSerially} or {@link TriggerWhenEmpty}. If this Annotation is + * used with either of these other Annotations, the Processor will not be + * eligible to be scheduled in Event-Driven mode. + * </p> + * + * @author none + */ +@Documented +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface EventDriven { + +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/SideEffectFree.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/SideEffectFree.java b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/SideEffectFree.java new file mode 100644 index 0000000..f32acc3 --- /dev/null +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/SideEffectFree.java @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.annotation.behavior; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marker annotation a {@link org.apache.nifi.processor.Processor Processor} + * implementation can use to indicate that its + * operations on FlowFiles can be safely repeated across process sessions. If a + * processor has this annotation and it allows the framework to manage session + * commit and rollback then the framework may elect to cascade a + * {@link org.apache.nifi.processor.ProcessSession ProcessSession} given to this + * processor's onTrigger method to the + * onTrigger method of another processor. It can do this knowing that if + * something fails along a series of processors using this same session that it + * can all be safely rolled back without any ill effects on external services + * which could not be rolled back and thus all the processes could be safely + * repeated (implied idempotent behavior). + * + * @author none + */ +@Documented +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface SideEffectFree { +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/SupportsBatching.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/SupportsBatching.java b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/SupportsBatching.java new file mode 100644 index 0000000..f5fd61f --- /dev/null +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/SupportsBatching.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.annotation.behavior; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marker annotation a Processor implementation can use to indicate that users + * should be able to supply a Batch Duration for the Processor. If a Processor + * uses this annotation, it is allowing the Framework to batch + * {@link nifi.processor.ProcessSession ProcessSession}s' commits, as well as + * allowing the Framework to return the same ProcessSession multiple times from + * subsequent calls to + * {@link nifi.processor.ProcessSessionFactory ProcessSessionFactory}. + * {@link nifi.processor.ProcessSessionFactory#createSession() createSession()}. + * + * When this Annotation is used, it is important to note that calls to + * {@link nifi.processor.ProcessSession#commit() ProcessSession.commit()} may + * not provide a guarantee that the data has been safely stored in NiFi's + * Content Repository or FlowFile Repository. Therefore, it is not appropriate, + * for instance, to use this annotation if the Processor will call + * ProcessSession.commit() to ensure data is persisted before deleting the data + * from a remote source. + * + * @author none + */ +@Documented +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface SupportsBatching { + +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerSerially.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerSerially.java b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerSerially.java new file mode 100644 index 0000000..7bf7d0b --- /dev/null +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerSerially.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.annotation.behavior; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marker annotation a {@link org.apache.nifi.processor.Processor Processor} + * implementation can use to indicate that the + * Processor is not safe for concurrent execution of its onTrigger() + * method. By default, Processors are assumed to be safe for concurrent + * execution. + * + * @author none + */ +@Documented +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface TriggerSerially { +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerWhenAnyDestinationAvailable.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerWhenAnyDestinationAvailable.java b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerWhenAnyDestinationAvailable.java new file mode 100644 index 0000000..803aa2f --- /dev/null +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerWhenAnyDestinationAvailable.java @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.annotation.behavior; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marker annotation a {@link org.apache.nifi.processor.Processor Processor} + * implementation can use to indicate that the + * Processor is to be triggered if any of its destinations has available space + * for incoming FlowFiles. By default, Processors are triggered only when all + * destinations report that they have available space (i.e., none of the outgoing + * Connections is full). + * + * @author none + */ +@Documented +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface TriggerWhenAnyDestinationAvailable { + +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerWhenEmpty.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerWhenEmpty.java b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerWhenEmpty.java new file mode 100644 index 0000000..fed9b34 --- /dev/null +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/behavior/TriggerWhenEmpty.java @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.annotation.behavior; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marker annotation a {@link org.apache.nifi.processor.Processor Processor} + * implementation can use to indicate that the + * Processor should still be triggered even when it has no data in its work + * queue. By default, Processors which have no non-self incoming edges will be + * triggered even if there is no work in its queue. However, Processors that + * have non-self incoming edges will only be triggered if they have work in + * their queue or they present this annotation. + * + * @author none + */ +@Documented +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface TriggerWhenEmpty { +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/documentation/CapabilityDescription.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/documentation/CapabilityDescription.java b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/documentation/CapabilityDescription.java new file mode 100644 index 0000000..d69788a --- /dev/null +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/documentation/CapabilityDescription.java @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.annotation.documentation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Annotation that may be placed on a {@link org.apache.nifi.processor.Processor Processor}, + * {@link org.apache.nifi.controller.ControllerService ControllerService}, or + * {@link org.apache.nifi.reporting.ReportingTask ReportingTask} allowing for a description to be + * provided. This description can be provided to a user in logs, UI, etc. + * + * @author none + */ +@Documented +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface CapabilityDescription { + + String value(); +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/documentation/Tags.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/documentation/Tags.java b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/documentation/Tags.java new file mode 100644 index 0000000..8bd8f9a --- /dev/null +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/documentation/Tags.java @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.annotation.documentation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Annotation that can be applied to a {@link org.apache.nifi.processor.Processor Processor}, + * {@link org.apache.nifi.controller.ControllerService ControllerService}, or + * {@link org.apache.nifi.reporting.ReportingTask ReportingTask} in order to associate + * tags (keywords) with the component. These tags do not affect the component in + * any way but serve as additional documentation and can be used to sort/filter + * Processors. + * + * @author none + */ +@Documented +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface Tags { + + /** + * @return all tag values associated with the given processor + */ + public String[] value(); +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnAdded.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnAdded.java b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnAdded.java new file mode 100644 index 0000000..acb7a4d --- /dev/null +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnAdded.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.annotation.lifecycle; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +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} + * implementation can use to indicate a method + * should be called whenever the component is added to the flow. This method + * will be called once for the entire life of a component instance. + * + * If any method annotated with this annotation throws a Throwable, the component + * will not be added to the flow. + * + * @author none + */ +@Documented +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface OnAdded { +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnRemoved.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnRemoved.java b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnRemoved.java new file mode 100644 index 0000000..696159f --- /dev/null +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnRemoved.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.annotation.lifecycle; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +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} implementation + * can use to indicate a method should be called whenever the component is removed + * from the flow. This method will be called once for the entire life of a + * component instance. If the method throw any Throwable, that Throwable will be + * caught and logged but will not prevent subsequent methods with this annotation + * or removal of the component from the flow. + * + * @author none + */ +@Documented +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface OnRemoved { +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnScheduled.java ---------------------------------------------------------------------- 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 new file mode 100644 index 0000000..9dfd150 --- /dev/null +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnScheduled.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.annotation.lifecycle; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +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. + * + * <p> + * Methods using this annotation must take either 0 arguments or a single argument. + * </p> + * + * <p> + * If using 1 argument and the component using the annotation is a Processor, that argument must + * be of type {@link org.apache.nifi.processor.ProcessContext ProcessContext}. + * </p> + * + * <p> + * If using 1 argument and the component using the annotation is a Reporting Task, that argument must + * be of type {@link org.apache.nifi.reporting.ReportingContext ReportingContext}. + * </p> + * + * If any method annotated with this annotation throws any Throwable, the framework will wait a while + * and then attempt to invoke the method again. This will continue until the method succeeds, and the + * component will then be scheduled to run after this method return successfully. + * + * @author none + */ +@Documented +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface OnScheduled { +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnShutdown.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnShutdown.java b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnShutdown.java new file mode 100644 index 0000000..a4129e1 --- /dev/null +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnShutdown.java @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.annotation.lifecycle; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +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} implementation + * can use to indicate a method should be called whenever the flow is being shutdown. + * This will be called at most once for each component in a JVM lifetime. + * It is not, however, guaranteed that this method will be called on shutdown, as + * the service may be killed suddenly. + * + * @author none + */ +@Documented +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface OnShutdown { +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnStopped.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnStopped.java b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnStopped.java new file mode 100644 index 0000000..4715253 --- /dev/null +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnStopped.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.annotation.lifecycle; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * <p> + * Marker annotation a {@link org.apache.nifi.processor.Processor Processor} or + * {@link org.apache.nifi.reporting.ReportingTask 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 <code>onTrigger</code> method. + * </p> + * + * <p> + * 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. + * </p> + * + * <p> + * 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 + * <code>onTrigger</code> method), see the {@link OnUnscheduled} annotation. + * </p> + * + * @author none + */ +@Documented +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface OnStopped { + +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnUnscheduled.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnUnscheduled.java b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnUnscheduled.java new file mode 100644 index 0000000..68d0fe8 --- /dev/null +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/annotation/lifecycle/OnUnscheduled.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.annotation.lifecycle; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * <p> + * Marker annotation a {@link org.apache.nifi.processor.Processor Processor} or + * {@link org.apache.nifi.reporting.ReportingTask ReportingTask} + * should be called whenever the component is no longer scheduled to run. + * Methods marked with this annotation will be invoked each time the framework + * is notified to stop scheduling the component. This method is invoked as other + * threads are potentially running. To invoke a method after all threads have + * finished processing, see the {@link OnStopped} annotation. + * </p> + * + * @author none + */ +@Documented +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface OnUnscheduled { +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/0f310325/nifi/nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java b/nifi/nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java new file mode 100644 index 0000000..37bcf23 --- /dev/null +++ b/nifi/nifi-mock/src/test/java/org/apache/nifi/util/TestStandardProcessorTestRunner.java @@ -0,0 +1,86 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.util; + +import org.apache.nifi.processor.AbstractProcessor; +import org.apache.nifi.processor.ProcessContext; +import org.apache.nifi.processor.ProcessSession; +import org.apache.nifi.processor.exception.ProcessException; +import org.junit.Test; + +public class TestStandardProcessorTestRunner { + + @Test(expected=AssertionError.class) + public void testFailOnDeprecatedTypeAnnotation() { + new StandardProcessorTestRunner(new DeprecatedAnnotation()); + } + + @Test + public void testDoesNotFailOnNonDeprecatedTypeAnnotation() { + new StandardProcessorTestRunner(new NewAnnotation()); + } + + @Test(expected=AssertionError.class) + public void testFailOnDeprecatedMethodAnnotation() { + new StandardProcessorTestRunner(new DeprecatedMethodAnnotation()); + } + + @Test + public void testDoesNotFailOnNonDeprecatedMethodAnnotation() { + new StandardProcessorTestRunner(new NewMethodAnnotation()); + } + + + + @SuppressWarnings("deprecation") + @org.apache.nifi.processor.annotation.Tags({"deprecated"}) + private static class DeprecatedAnnotation extends AbstractProcessor { + @Override + public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException { + } + } + + @org.apache.nifi.annotation.documentation.Tags({"deprecated"}) + private static class NewAnnotation extends AbstractProcessor { + @Override + public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException { + } + } + + private static class NewMethodAnnotation extends AbstractProcessor { + @org.apache.nifi.annotation.lifecycle.OnScheduled + public void dummy() { + + } + + @Override + public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException { + } + } + + private static class DeprecatedMethodAnnotation extends AbstractProcessor { + @SuppressWarnings("deprecation") + @org.apache.nifi.processor.annotation.OnScheduled + public void dummy() { + + } + + @Override + public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException { + } + } +}