Logging
This commit is contained in:
parent
7851d09cfb
commit
f2da26496c
|
@ -14,21 +14,22 @@ import java.util.Set;
|
|||
public class PluginsReflections {
|
||||
|
||||
/** Loads Plugin implementation classes. It should only be accessed once by Plugin Manager
|
||||
* Plugins shouldn't access this unless this class for testing purposes.
|
||||
* Plugins shouldn't access this class unless for testing purposes.
|
||||
* @return
|
||||
*/
|
||||
public static Map<String,Plugin> load(){
|
||||
Map<String,Plugin> toReturn=new HashMap<>();
|
||||
log.warn("WARNING!! LOADING PLUGIN SET : THIS SHOULD HAPPEN ONLY ONCE");
|
||||
log.warn("WARNING!! LOADING PLUGIN CLASSES : THIS SHOULD HAPPEN ONLY ONCE");
|
||||
Reflections reflections = new Reflections(
|
||||
new ConfigurationBuilder()
|
||||
.forPackage("org.gcube.application.cms")
|
||||
.filterInputsBy(new FilterBuilder().includePackage("org.gcube.application.cms")));
|
||||
|
||||
reflections.getSubTypesOf(Plugin.class).iterator().forEachRemaining(pluginClass->{
|
||||
if(!pluginClass.isInterface() && !Modifier.isAbstract(pluginClass.getModifiers())){
|
||||
log.trace("Evaluating class ");
|
||||
log.trace("Evaluating class {}",pluginClass);
|
||||
if(!pluginClass.isInterface() && !Modifier.isAbstract(pluginClass.getModifiers())){
|
||||
try {
|
||||
log.debug("Found implementation {} ",pluginClass);
|
||||
Plugin plugin = pluginClass.newInstance();
|
||||
log.debug("Loading {} description : {}", plugin, plugin.getDescriptor());
|
||||
|
||||
|
|
Loading…
Reference in New Issue