This interface is implemented by anything which wants to be a plugin manager. It is implemented by PluginManager as well as ServiceManager and WorkerPool, which also accept plugins of their own.
public interface IPluginManager
{
    /**
     * Add plugin by class. An instance will be contructed only if needed on lookup
     * or eager-initialised.
     * @param name  Name of plugin. If this is null the plugin
     *              is considered to have no name.
     * @param type  Type of plugin. Must implement IPlugin.
     * @param argument_data  Argument data to pass to the init method of the IPlugin.
     * @param eager_initialise If true, initialise plugin on add
     * @throws BeatrixPluginException  If the <code>type</code> does not
     *             implement IPlugin, or initialisation fails in some way.
     */
    public void add(String name, Class type, Object argument_data, boolean eager_initialise)
        throws BeatrixPluginException;
    /**
     * Shortcut for <code>add(null, type, null, eager_initialise)</code>.
     */
    public void add(Class type, boolean eager_initialise)
        throws BeatrixPluginException;
    /**
     * Add specific instance of a plugin.
     * @param name  Name of plugin. If this is null the plugin
     *              is considered to have no name.
     * @param type  Type of plugin. Must implement IPlugin.
     * @param argument_data  Argument data to pass to the init method of the IPlugin.
     * @param eager_initialise If true, initialise plugin on add.
     * @throws BeatrixPluginException  If initialisation fails in some way.
     */
    public void add(String name, IPlugin plugin, Object argument_data, boolean eager_initialise)
        throws BeatrixPluginException;
    /**
     * Shortcut for <code>add(null, plugin, null, eager_initialise)</code>.
     */
    public void add(IPlugin plugin, boolean eager_initialise)
        throws BeatrixPluginException;
    /**
     * Remove all matching plugins. Each such plugin will have
     * its shutdown method called if it was previously
     * initialised successfully.
     * @param name   Required name for matching plugins. If null
     *               then plugin names are not tested.
     * @param type   Required type for matching plugins. The plugin must
     *               implement or extend this type; it must be it. If null
     *               then plugin types are not tested.
     */
    public void remove(String name, Class type);
    /**
     * Remove all plugins of a particular type.
     * Shortcut for <code>remove(null, type)</code>.
     */
    public void remove(Class type);
    /**
     * Find all matching plugins. Those plugins returned will
     * have been initialised.
     * @param name   Required name for matching plugins. If null
     *               then plugin names are not tested for.
     * @param type   Interface the matching plugins have to implement.
     *               If null then plugin types are not tested for.
     * @return All plugins found with this criteria. Will be a
     *         zero-length array if no matches.
     */
    public Object[] lookup(String name, Class type);
    /**
     * Find all plugins of the specified type.
     * Shortcut for <code>lookup(null, type)</code>.
     */
    public Object[] lookup(Class type);
    /**
     * Find all plugins with the specified name.
     * Shortcut for <code>lookup(name, null)</code>.
     */
    public Object[] lookup(String name);
    /** Shutdown and remove all plugins. Only those plugins
     * which have previously been successfully initialised
     * have their shutdown method called. */
    public void shutdown();
}
Nik Silver 2002-03-09