My favorites | Sign in
Project Logo
                
Code license: New BSD License
Labels: java, ioc, container, plugin, manager
Show all Featured downloads:
jspf-0.5.0.bin.zip

What it does

The Java Simple Plugin Framework was built to reduce development time while increasing code maintainability of small to medium sized projects.

(See the FAQ for more information)

(Also have a look at the Introduction-Video. Note: The video was recorded in real time, If you're a Java professional, you should skip forward manually to see the interesting parts)

What it new in this version (0.5.0-beta, May 2009)

A short example

(See the Usage Guide for more information)

The following two lines demonstrate how easy it is to load existing plugins. All .JAR files inside the given directory will be examined for contained plugins which will afterwards be loaded and automatically started. No configuration files are required, nothing else has to be done.

PluginManager pm = PluginManagerFactory.createPluginManager();

pm.addPluginsFrom(new File("myPluginDir/").toURI());

// or 

pm.addPluginsFrom(new File("myPluginDir/myPlugin.jar").toURI());

// or 

pm.addPluginsFrom(new URI("classpath://*"));

Creating a new plugin is equally straightforward. After an interface has been designed the rest can be done by a simple annotation. The next example shows a plugin implementation that could be loaded again by JSPF, and also here: no XML- or whatsoever-files have to be created to make this work.

@PluginImplementation
public class CoolPluginImpl implements CoolPlugin {

    public String provideData() {
        return "I am your String";
    }

}

Our last two snippes indicates how plugins can be obtained from outside, and the inside of plugins. Notice the type-safety:

CoolPlugin cool = pm.getPlugin(CoolPlugin.class);

Or, from inside of plugins:

@InjectPlugin
public CoolPlugin cool;

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. Or if you're coding some software where you expect plugins to be loaded using some kind of easy IoC.

Known Users

History

This project was initially developed by Ralf Biedert. I (Nicolas Delsaux) only suggested him I could make it more sharable by putting it on code.google.com, creating a maven project, and add some little features. Thomas Lottermann contributed to various plugins.









Hosted by Google Code