You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by al...@apache.org on 2017/08/10 19:21:14 UTC
nifi git commit: NIFI-968 - add @OnPrimaryNodeStateChange to dev guide
Repository: nifi
Updated Branches:
refs/heads/master 18c82eb6a -> c03f4e731
NIFI-968 - add @OnPrimaryNodeStateChange to dev guide
This closes #2027.
Signed-off-by: Andy LoPresto <al...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/c03f4e73
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/c03f4e73
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/c03f4e73
Branch: refs/heads/master
Commit: c03f4e731bbc9ac3a74d1e1ca800942b5b73dc23
Parents: 18c82eb
Author: Pierre Villard <pi...@gmail.com>
Authored: Fri Jul 21 12:00:18 2017 +0200
Committer: Andy LoPresto <al...@apache.org>
Committed: Thu Aug 10 12:21:04 2017 -0700
----------------------------------------------------------------------
.../src/main/asciidoc/developer-guide.adoc | 22 ++++++++++++++++++++
1 file changed, 22 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/c03f4e73/nifi-docs/src/main/asciidoc/developer-guide.adoc
----------------------------------------------------------------------
diff --git a/nifi-docs/src/main/asciidoc/developer-guide.adoc b/nifi-docs/src/main/asciidoc/developer-guide.adoc
index 7b31cb5..55d79f1 100644
--- a/nifi-docs/src/main/asciidoc/developer-guide.adoc
+++ b/nifi-docs/src/main/asciidoc/developer-guide.adoc
@@ -564,6 +564,28 @@ while methods using this annotation can be used to clean up resources,
for instance, they should not be
relied upon for critical business logic.
+=== Component Notification
+
+The NiFi API provides notification support through use of Java
+Annotations. The `org.apache.nifi.annotations.notification` package
+contains several annotations for notification management. The following
+annotations may be applied to Java methods in a NiFi component to
+indicate to the framework when the methods should be called. For the
+discussion of Component Notification, we will define a NiFi component
+as a *Processor*, *Controller Service*, or *Reporting Task*.
+
+==== @OnPrimaryNodeStateChange
+
+The `@OnPrimaryNodeStateChange` annotation causes a method to be invoked
+as soon as the state of the Primary Node in a cluster has changed.
+Methods with this annotation should take either no arguments or one
+argument of type `PrimaryNodeState`. The `PrimaryNodeState` provides
+context about what changed so that the component can take appropriate
+action. The `PrimaryNodeState` enumerator has two possible values:
+`ELECTED_PRIMARY_NODE` (the node receiving this
+state has been elected the Primary Node of the NiFi cluster), or
+`PRIMARY_NODE_REVOKED` (the node receiving this state was the Primary
+Node but has now had its Primary Node role revoked).
[[restricted]]
=== Restricted