jdaugherty commented on code in PR #15409:
URL: https://github.com/apache/grails-core/pull/15409#discussion_r2975528523


##########
grails-core/src/main/groovy/org/apache/grails/core/plugins/GrailsPluginDiscovery.java:
##########
@@ -0,0 +1,148 @@
+/*
+ *  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
+ *
+ *    https://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.grails.core.plugins;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.springframework.core.env.Environment;
+import org.springframework.core.io.Resource;
+
+import grails.plugins.PluginFilter;
+
+/**
+ * This class is responsible for locating Grails Plugins that should be loaded.
+ *
+ * @since 7.1
+ */
+public interface GrailsPluginDiscovery {
+
+    /**
+     * After the bootstrap process, the name of the bean that this plugin 
discovery will be promoted with
+     */
+    String BEAN_NAME = "grailsPluginDiscovery";
+
+    /**
+     * Initializes the plugin discovery mechanism. This method is called 
during the {@link grails.boot.config.GrailsEnvironmentPostProcessor}
+     *
+     * @param environment the environment to check for plugin exclusions
+     */
+    void init(Environment environment);
+
+    /**
+     * This method is typically only used in testing, specifically unit tests.
+     *
+     * @return Plugins that were defined dynamically outside of the classpath
+     */
+    GrailsPluginInfo[] getDynamicPlugins();
+
+    /**
+     * @return Plugins that failed to load during the discovery process
+     */
+    Map<String, GrailsPluginInfo> getFailedPlugins();
+
+    /**
+     * @return Plugins that were discovered during the bootstrap process, no 
ordering guaranteed
+     */
+    Collection<GrailsPluginInfo> getPlugins();
+
+    /**
+     * @param pluginName a plugin name to search for, the name may not be 
normalized
+     * @return the plugin information if found
+     */
+    GrailsPluginInfo getPlugin(String pluginName);

Review Comment:
   I refactored this method into 2 separate processes.  There's now an init() 
call instead of initializing on the get.  This means the getters are just 
getters now. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to