summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorDecebal Suiu <decebal.suiu@gmail.com>2013-02-20 11:35:54 +0200
committerDecebal Suiu <decebal.suiu@gmail.com>2013-02-20 11:35:54 +0200
commit1b867d151c62834ce3cab0cfcc46e8ff3663d5f9 (patch)
tree71301a3aa246339079456a9c6c3eb0825a1dcaf9 /README.md
parent2d971079be8f0a95f63be390601c5cc74f70e951 (diff)
downloadpf4j-1b867d151c62834ce3cab0cfcc46e8ff3663d5f9.tar.gz
pf4j-1b867d151c62834ce3cab0cfcc46e8ff3663d5f9.zip
Update README.md
Diffstat (limited to 'README.md')
-rw-r--r--README.md25
1 files changed, 17 insertions, 8 deletions
diff --git a/README.md b/README.md
index 6452569..81d9fcc 100644
--- a/README.md
+++ b/README.md
@@ -89,14 +89,6 @@ In this case the `classes/META-INF/MANIFEST.MF` file looks like:
In above manifest I described a plugin with id `welcome-plugin`, with class `ro.fortsoft.pf4j.demo.welcome.WelcomePlugin`, with version `0.0.1` and with dependencies
to plugins `x, y, z`.
-Also you can use any PluginDescriptorFinder (for example **PropertiesPluginDescriptorFinder**) in DefaultPluginManager (using setPluginDescriptorFinder() method).
-
- plugin.class=ro.fortsoft.pf4j.demo.welcome.WelcomePlugin
- plugin.dependencies=x, y, z
- plugin.id=welcome-plugin
- plugin.provider=Decebal Suiu
- plugin.version=0.0.1
-
You can define an extension point in your application using **ExtensionPoint** interface marker.
public interface Greeting extends ExtensionPoint {
@@ -139,6 +131,23 @@ The output is:
>>> Welcome
>>> Hello
+You can inject your custom component (for example PluginDescriptorFinder, ExtensionFinder) in DefaultPluginManager just override createXXX methods (factory method pattern).
+
+Example:
+
+ protected PluginDescriptorFinder createPluginDescriptorFinder() {
+ return new PropertiesPluginDescriptorFinder();
+ }
+
+and in plugin respository you must have a plugin.properties file with the below content:
+
+ plugin.class=ro.fortsoft.pf4j.demo.welcome.WelcomePlugin
+ plugin.dependencies=x, y, z
+ plugin.id=welcome-plugin
+ plugin.provider=Decebal Suiu
+ plugin.version=0.0.1
+
+
For more information please see the demo sources.
Demo