Skip to content

Commit 310ed29

Browse files
committed
NIFI-14371 add support for DisallowRunOnce annotation
1 parent 1d6fafb commit 310ed29

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.apache.nifi.annotation.behavior;
18+
19+
import java.lang.annotation.Documented;
20+
import java.lang.annotation.ElementType;
21+
import java.lang.annotation.Inherited;
22+
import java.lang.annotation.Retention;
23+
import java.lang.annotation.RetentionPolicy;
24+
import java.lang.annotation.Target;
25+
26+
/**
27+
* <p>
28+
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor}
29+
* implementation can use to indicate that the Processor is not designed in
30+
* such a way that the 'Run Once' capability would function.
31+
* </p>
32+
*
33+
* <p>
34+
* Some processors need many execution cycles to perform any meaningful work
35+
* and as such the user triggering a 'Run Once' execution will likely result
36+
* in no response or outcome at all.
37+
* </p>
38+
*/
39+
@Documented
40+
@Target({ElementType.TYPE})
41+
@Retention(RetentionPolicy.RUNTIME)
42+
@Inherited
43+
public @interface DisallowRunOnce {
44+
45+
/**
46+
* An optional explanation for why run once is not supported
47+
* @return explanation string that may end up being shared with users
48+
*/
49+
String explanation();
50+
51+
}

0 commit comments

Comments
 (0)