Package net.groboclown.util.jplugin.v1

The jplugin package allows for easy use of "plugins" into your application.

See:
          Description

Class Summary
ClassAttributes  
ClassSorter Discovers the classes and beans inside of a Jar file.
ClassWrapper Wraps the class description up in a neat package
DirectoryInspector Discovers the classes and beans inside of a filesystem directory.
Inspector Discovers the classes in a URL.
JarInspector Discovers the classes and beans inside of a Jar file.
PluginLoader Discovers the classes and beans inside of URLs.
PluginLoader.UrlRecurse  
PropertyList This class stores all the properties found.
SingleClassInspector Discovers the classes and beans inside of a URL.
URLInspector Discovers the classes inside of a URL.
 

Package net.groboclown.util.jplugin.v1 Description

The jplugin package allows for easy use of "plugins" into your application.

A plugin is a collection of code which can be bound to at run-time, allowing for a more dynamic application. This is useful for allowing easy upgrades, and addition of new functionality.

Usage

  1. instantiate an instance of PluginLoader, specifying where the plugins should be located:
            PluginLoader pl = new PluginLoader( new URL( "file:"+baseDir ) );
            
  2. setup all the manifest attributes and base classes that you wish to pay attention to:
            pl.addClassSet( BasePluginSuperclass.class );
            pl.addAttributeSet( "bean", "true" );
            pl.addAttributeSet( "aPlugin" );
            
  3. next, tell the loader to find all classes which match any of the specified class or attribute sets.
            pl.findPlugins();
            
    This will load all manifest files ("*.MF"), class files ("*.class"), and Jar files ("*.jar" or "*.zip"). It will sort all class files by the sets specified.
  4. to find all classes which match a set criteria, make a call with the criteria initially specified, as so:
            ClassWrapper cw[] = pl.getPlugins( BasePluginSuperclass.class );
            cw = pl.getPlugins( "bean" );
            cw = pl.getPlugins( "aPlugin" );
            
  5. the ClassWrapper will contain detailed information about the specific plugin.



Written under the LGPL