diff options
Diffstat (limited to 'pf4j/src/main/java/ro/fortsoft/pf4j/PluginLoader.java')
-rw-r--r-- | pf4j/src/main/java/ro/fortsoft/pf4j/PluginLoader.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/PluginLoader.java b/pf4j/src/main/java/ro/fortsoft/pf4j/PluginLoader.java index 8bd2daa..03e7683 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/PluginLoader.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/PluginLoader.java @@ -1,11 +1,11 @@ /* * Copyright 2012 Decebal Suiu - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * the License. You may obtain a copy of the License in the LICENSE file, or at: - * + * * http://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. @@ -46,10 +46,11 @@ class PluginLoader { public PluginLoader(PluginManager pluginManager, PluginDescriptor pluginDescriptor, File pluginRepository, PluginClasspath pluginClasspath) { this.pluginRepository = pluginRepository; - this.pluginClasspath = pluginClasspath; - ClassLoader parent = getClass().getClassLoader(); - pluginClassLoader = new PluginClassLoader(pluginManager, pluginDescriptor, parent); - log.debug("Created class loader {}", pluginClassLoader); + this.pluginClasspath = pluginClasspath; + + ClassLoader parent = getClass().getClassLoader(); + pluginClassLoader = new PluginClassLoader(pluginManager, pluginDescriptor, parent); + log.debug("Created class loader '{}'", pluginClassLoader); } public File getPluginRepository() { @@ -70,15 +71,15 @@ class PluginLoader { private boolean loadClasses() { List<String> classesDirectories = pluginClasspath.getClassesDirectories(); - + // add each classes directory to plugin class loader for (String classesDirectory : classesDirectories) { // make 'classesDirectory' absolute File file = new File(pluginRepository, classesDirectory).getAbsoluteFile(); - + if (file.exists() && file.isDirectory()) { log.debug("Found '{}' directory", file.getPath()); - + try { pluginClassLoader.addURL(file.toURI().toURL()); log.debug("Added '{}' to the class loader path", file); @@ -98,12 +99,12 @@ class PluginLoader { */ private boolean loadJars() { List<String> libDirectories = pluginClasspath.getLibDirectories(); - + // add each jars directory to plugin class loader for (String libDirectory : libDirectories) { // make 'libDirectory' absolute File file = new File(pluginRepository, libDirectory).getAbsoluteFile(); - + // collect all jars from current lib directory in jars variable Vector<File> jars = new Vector<File>(); getJars(jars, file); |