Java Simple Plugin Framework - The DoYouNeedThis?-Edition
May 14th, 2008 by rb
Update (20.5.) : Project now hosted at Google Code
During my diploma thesis I was in need of a Java based plugin (aka component) architecture that allowed to hide implementation details and was simple and easy to use. While JPF surely is powerful I felt not quite satisfied with its straightforwardness. So I created the “Java Simple Plugin Framework” (License: BSD).
What it does:
- It allows you to completely hide implementation details of a component. You only touch their interfaces.
- Components can be loaded with only two(!) lines of code, and created with only one additional line of code
- JSPF is heavily annotation based: Plugins are defined by the @PluginImplementation annotation, other plugins may be injected using @InjectPlugin, timers and threads for plugin methods may be defined by @Timer and @Thread
- Through its heavy usage of generics it is type safe. Mostly there is no casting required.
- It supports a bus to exchange messages easily while keeping the components decoupled.
- Plugins may be exported by XMLRPC
- Supports configuration loading
When to use it:
If you are, for example, a researcher and want to quickly develop a prototype, if you intend to change implementations frequently but want to keep your code (at least partially) clean, and if you think about reusing components in other prototypes you might want to give it a try.
When not to use it:
For every product someone’s life, income, car, pet or sanity depends on. I consider this software ‘alpha’. While it did and does work for me very well and has not produced any significant problem yet, I am absolutely sure there are still some major bugs in it.
“Screenshots”


Why did I publish it?
When I started my thesis I really was looking for something like this, but didn’t find anything. However, maintaining a software project is arduous, and I currently don’t have (or better: feel like taking) the time to setup a CVS and care for it professionally. This means two things. If you like the project and are inclined to adopt it, just do it. However, if I get enough positive feedback I might think about doing it myself (someday).
Download
Hi, i find your java simple plugin framework far more interesting that JPF, and i would like to use it for one of my personnal projects.
However, being a maven fan, I would lmargely prefer to have a maven artifact to deploy in. Can it be the case in some future ?
Could you please drop me a mail ? since i’m in the process of increasing both your code with multiple plugins implementing the same plugin interface, and improving your code usability by making a maven project from it. I would indeed like to know how could I do that the best way and which license you would expect to give to your child ?
I’ll contact you as soon as i figure out your mail address from wordpress
Updated to a new version. Here is the changelog:
- Loading a single JAR was not possible due to a misplaced return statement
- Testcases created
- Parameter checking introduced
- Thread-safety to core plugins added
- Changelog created
- XMLRPC package moved
- Joined all external JARs into one single JAR for beautification
- Added (but not yet implemented) method to unexport plugins over network
- Prevented the XMLRPC server from starting automatically -> reduced startup time, no need for System.exit() as long as you don’t export plugins.
Updated to 0.2.1:
- Fixed MacOS (and probably Linux) showstopper that prevented one from adding plugins on these platforms. Now verified that the system works on MacOS 10.5 with Java 1.5.