]> source.dussan.org Git - pf4j.git/commitdiff
#107
authorDecebal Suiu <decebal.suiu@gmail.com>
Wed, 10 Aug 2016 05:56:11 +0000 (08:56 +0300)
committerDecebal Suiu <decebal.suiu@gmail.com>
Wed, 10 Aug 2016 05:56:11 +0000 (08:56 +0300)
pf4j/src/main/java/ro/fortsoft/pf4j/ManifestPluginDescriptorFinder.java
pf4j/src/main/java/ro/fortsoft/pf4j/PropertiesPluginDescriptorFinder.java

index 0d23346f6e219f48c686954537dcd0167d3b8253..24ae75196e993f16983635a69e6645d2969d9fe5 100644 (file)
@@ -85,7 +85,7 @@ public class ManifestPluginDescriptorFinder implements PluginDescriptorFinder {
     }
 
     protected PluginDescriptor createPluginDescriptor(Manifest manifest) {
-        PluginDescriptor pluginDescriptor = new PluginDescriptor();
+        PluginDescriptor pluginDescriptor = createPluginDescriptorInstance();
 
         // TODO validate !!!
         Attributes attributes = manifest.getMainAttributes();
@@ -120,6 +120,10 @@ public class ManifestPluginDescriptorFinder implements PluginDescriptorFinder {
         return pluginDescriptor;
     }
 
+    protected PluginDescriptor createPluginDescriptorInstance() {
+        return new PluginDescriptor();
+    }
+
     protected void validatePluginDescriptor(PluginDescriptor pluginDescriptor) throws PluginException {
         if (StringUtils.isEmpty(pluginDescriptor.getPluginId())) {
             throw new PluginException("Plugin-Id cannot be empty");
index 76c3750ec9b6d255c544a8be4f6883b08418846d..544d76e48d28fdcc26dde819ebbc3cd33debc463 100644 (file)
@@ -89,7 +89,7 @@ public class PropertiesPluginDescriptorFinder implements PluginDescriptorFinder
     }
 
     protected PluginDescriptor createPluginDescriptor(Properties properties) {
-        PluginDescriptor pluginDescriptor = new PluginDescriptor();
+        PluginDescriptor pluginDescriptor = createPluginDescriptorInstance();
 
         // TODO validate !!!
         String id = properties.getProperty("plugin.id");
@@ -112,6 +112,10 @@ public class PropertiesPluginDescriptorFinder implements PluginDescriptorFinder
         return pluginDescriptor;
     }
 
+    protected PluginDescriptor createPluginDescriptorInstance() {
+        return new PluginDescriptor();
+    }
+
     protected void validatePluginDescriptor(PluginDescriptor pluginDescriptor) throws PluginException {
         if (StringUtils.isEmpty(pluginDescriptor.getPluginId())) {
             throw new PluginException("plugin.id cannot be empty");