Repository: nifi Updated Branches: refs/heads/NIFI-655 e61ccea7a -> 0281e2773
NIFI-655: - Ensuring the login identity provider is able to switch context classloaders via the standard NAR mechanisms. Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/0281e277 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/0281e277 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/0281e277 Branch: refs/heads/NIFI-655 Commit: 0281e2773f3a8942c3794b0945675ef9336e8c28 Parents: e61ccea Author: Matt Gilman <[email protected]> Authored: Tue Nov 10 14:58:04 2015 -0500 Committer: Matt Gilman <[email protected]> Committed: Tue Nov 10 14:58:04 2015 -0500 ---------------------------------------------------------------------- .../java/org/apache/nifi/nar/ExtensionManager.java | 17 +++++------------ .../nifi/nar/NarThreadContextClassLoader.java | 2 ++ 2 files changed, 7 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/0281e277/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/ExtensionManager.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/ExtensionManager.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/ExtensionManager.java index 489b80e..db0b35e 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/ExtensionManager.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/ExtensionManager.java @@ -39,9 +39,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Scans through the classpath to load all FlowFileProcessors, - * FlowFileComparators, and ReportingTasks using the service provider API and - * running through all classloaders (root, NARs). + * Scans through the classpath to load all FlowFileProcessors, FlowFileComparators, and ReportingTasks using the service provider API and running through all classloaders (root, NARs). * * @ThreadSafe - is immutable */ @@ -61,18 +59,16 @@ public class ExtensionManager { definitionMap.put(ReportingTask.class, new HashSet<Class>()); definitionMap.put(ControllerService.class, new HashSet<Class>()); definitionMap.put(AuthorityProvider.class, new HashSet<Class>()); + definitionMap.put(LoginIdentityProvider.class, new HashSet<Class>()); definitionMap.put(ProvenanceEventRepository.class, new HashSet<Class>()); definitionMap.put(ComponentStatusRepository.class, new HashSet<Class>()); definitionMap.put(FlowFileRepository.class, new HashSet<Class>()); definitionMap.put(FlowFileSwapManager.class, new HashSet<Class>()); definitionMap.put(ContentRepository.class, new HashSet<Class>()); - definitionMap.put(LoginIdentityProvider.class, new HashSet<Class>()); } /** - * Loads all FlowFileProcessor, FlowFileComparator, ReportingTask class - * types that can be found on the bootstrap classloader and by creating - * classloaders for all NARs found within the classpath. + * Loads all FlowFileProcessor, FlowFileComparator, ReportingTask class types that can be found on the bootstrap classloader and by creating classloaders for all NARs found within the classpath. */ public static void discoverExtensions() { final ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader(); @@ -115,8 +111,7 @@ public class ExtensionManager { } /** - * Registers extension for the specified type from the specified - * ClassLoader. + * Registers extension for the specified type from the specified ClassLoader. * * @param type the extension type * @param classloaderMap mapping of classname to classloader @@ -154,9 +149,7 @@ public class ExtensionManager { } /** - * Determines the effective classloader for classes of the given type. If - * returns null it indicates the given type is not known or was not - * detected. + * Determines the effective classloader for classes of the given type. If returns null it indicates the given type is not known or was not detected. * * @param classType to lookup the classloader of * @return String of fully qualified class name; null if not a detected type http://git-wip-us.apache.org/repos/asf/nifi/blob/0281e277/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarThreadContextClassLoader.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarThreadContextClassLoader.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarThreadContextClassLoader.java index 9471ba6..9e9bd03 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarThreadContextClassLoader.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarThreadContextClassLoader.java @@ -23,6 +23,7 @@ import java.net.URLClassLoader; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; +import org.apache.nifi.authentication.LoginIdentityProvider; import org.apache.nifi.authorization.AuthorityProvider; import org.apache.nifi.components.Validator; @@ -58,6 +59,7 @@ public class NarThreadContextClassLoader extends URLClassLoader { narSpecificClasses.add(StreamCallback.class); narSpecificClasses.add(ControllerService.class); narSpecificClasses.add(AuthorityProvider.class); + narSpecificClasses.add(LoginIdentityProvider.class); narSpecificClasses.add(ProvenanceEventRepository.class); narSpecificClasses.add(ComponentStatusRepository.class); narSpecificClasses.add(FlowFileRepository.class);
