Merge branch 'develop' into NIFI-250

Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/266d44b1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/266d44b1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/266d44b1

Branch: refs/heads/NIFI-250
Commit: 266d44b11c92cea51f882483adcfa898feeaac44
Parents: 97632fb e7d6d94
Author: Matt Gilman <[email protected]>
Authored: Tue Mar 31 16:11:12 2015 -0400
Committer: Matt Gilman <[email protected]>
Committed: Tue Mar 31 16:11:12 2015 -0400

----------------------------------------------------------------------
 .../src/main/asciidoc/administration-guide.adoc | 21 ++++--
 .../StandardControllerServiceProvider.java      |  6 ++
 .../tasks/ContinuallyRunConnectableTask.java    | 15 +++--
 .../StandardControllerServiceProviderTest.java  | 71 ++++++++++++++++++++
 .../service/util/TestControllerService.java     | 61 +++++++++++++++++
 ...org.apache.nifi.controller.ControllerService | 15 +++++
 .../cache/protocol/ProtocolHandshake.java       |  2 +-
 7 files changed, 180 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/266d44b1/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceProvider.java
----------------------------------------------------------------------
diff --cc 
nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceProvider.java
index 1e64223,7a8e22f..dfbfca5
--- 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceProvider.java
+++ 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceProvider.java
@@@ -137,10 -117,14 +137,16 @@@ public class StandardControllerServiceP
              final InvocationHandler invocationHandler = new 
InvocationHandler() {
                  @Override
                  public Object invoke(final Object proxy, final Method method, 
final Object[] args) throws Throwable {
+ 
+                       final String methodName = method.getName();
+                       if("initialize".equals(methodName) || 
"onPropertyModified".equals(methodName)){
+                               throw new UnsupportedOperationException(method 
+ " may only be invoked by the NiFi framework");
+                       }
+                       
                      final ControllerServiceNode node = 
serviceNodeHolder.get();
 -                    if (node.isDisabled() && 
!validDisabledMethods.contains(method)) {
 +                    final ControllerServiceState state = node.getState();
 +                    final boolean disabled = (state != 
ControllerServiceState.ENABLED); // only allow method call if service state is 
ENABLED.
 +                    if (disabled && !validDisabledMethods.contains(method)) {
                          // Use nar class loader here because we are 
implicitly calling toString() on the original implementation.
                          try (final NarCloseable narCloseable = 
NarCloseable.withNarLoader()) {
                              throw new IllegalStateException("Cannot invoke 
method " + method + " on Controller Service " + originalService + " because the 
Controller Service is disabled");

Reply via email to