diff options
author | Decebal Suiu <decebal.suiu@gmail.com> | 2012-11-07 13:40:33 +0200 |
---|---|---|
committer | Decebal Suiu <decebal.suiu@gmail.com> | 2012-11-07 13:40:33 +0200 |
commit | 07550657ef0412eae460e57439a8fc543b75233f (patch) | |
tree | 74a9be272ccd767baaca3dda1b872b5ae0783d85 /README.md | |
parent | 363b2b093ccecfc75fd28f49ca2aa139bbc6d1ce (diff) | |
download | pf4j-07550657ef0412eae460e57439a8fc543b75233f.tar.gz pf4j-07550657ef0412eae460e57439a8fc543b75233f.zip |
work on plugin dependecy
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -20,12 +20,6 @@ Artifacts Using Maven ------------------- -First you must install the pf4j artifacts in your local maven repository with: - - mvn clean install - -I will upload these artifacts in maven central repository as soon as possible. - In your pom.xml you must define the dependencies to PF4J artifacts with: ```xml @@ -43,8 +37,8 @@ How to use It's very simple to add pf4j in your application: public static void main(String[] args) { - ... - + ... + PluginManager pluginManager = new DefaultPluginManager(); pluginManager.loadPlugins(); pluginManager.startPlugins(); @@ -118,11 +112,15 @@ In above code I supply an extension for the `Greeting` extension point. You can retrieve all extensions for an extension point with: - List<ExtensionWrapper<Greeting>> greetings = pluginManager.getExtensions(Greeting.class); - for (ExtensionWrapper<Greeting> greeting : greetings) { - System.out.println(">>> " + greeting.getInstance().getGreeting()); + List<Greeting> greetings = pluginManager.getExtensions(Greeting.class); + for (Greeting greeting : greetings) { + System.out.println(">>> " + greeting.getGreeting()); } +The output is: + + >>> Welcome + >>> Hello For more information please see the demo sources. |