JPF "runtime" class - the entry point to the framework API. It is expected
that only one instance of this class will be created per application (other
scenarios may be possible but not tested).
Usage example. Somewhere in the beginning of your application:
Activates plug-in with given ID if it is not activated yet. Actually this
makes plug-in "running" and calls
Plugin.doStart method. This
method will effectively activate all depending plug-ins. It is safe to
call this method more than once.
Parameters: id - plug-in ID throws: PluginLifecycleException - if plug-in can't be found or activated
Deactivates plug-in with given ID if it has been successfully activated
before. This method makes plug-in "not running" and calls
Plugin.doStop method. Note that this method will effectively
deactivate all depending plug-ins.
Parameters: id - plug-in ID
Disables plug-in (with dependencies) in this manager instance. Disabled
plug-in can't be activated although it may be valid and successfully
registered with plug-in registry. Before disabling, plug-in will be
deactivated if it was successfully activated.
Be careful with this method as it can effectively disable large set of
inter-depending plug-ins and your application may become unstable or even
disabled as whole.
Parameters: descr - descriptor of plug-in to be disabled descriptors of plug-ins that was actually disabled
Enables plug-in (or plug-ins) in this manager instance. Don't miss this
with plug-in activation semantic. Enabled plug-in is simply ready to be
activated. By default all loaded plug-ins are enabled.
Parameters: descr - descriptor of plug-in to be enabled Parameters: includeDependings - if true, depending plug-ins will be alsoenabled descriptors of plug-ins that was actually enabled See Also:PluginManager.disablePlugin(PluginDescriptor)
Looks for plug-in with given ID and activates it if it is not activated
yet. Note that this method will never return null.
Parameters: id - plug-in ID found plug-in throws: PluginLifecycleException - if plug-in can't be found or activated
Returns instance of plug-in's class loader and not tries to activate
plug-in. Use this method if you need to get access to plug-in resources
and don't want to cause plug-in activation.
Parameters: descr - plug-in descriptor class loader instance for plug-in with given descriptor
Looks for plug-in, given object belongs to.
Parameters: obj - any object that maybe belongs to some plug-in plug-in or null if given object doesn't belong toany plug-in (possibly it is part of "host" application) and thusdoesn't managed by the Framework directly or indirectly
Initializes given plug-in with this manager instance and given
descriptor.
Parameters: plugin - plug-in instance to be initialized Parameters: descr - plug-in descriptor
Looks for plug-in manager instance for given object.
Parameters: obj - any object that may be managed by some plug-in manager plug-in manager instance or null if given objectdoesn't belong to any plug-in (possibly it is part of "host"application) and thus doesn't managed by the Framework directlyor indirectly.
Registers plug-ins and their locations with this plug-in manager. You
should use this method to register new plug-ins to make them available
for activation with this manager instance (compare this to
PluginRegistry.register(URL[]) method that just makes plug-in's
meta-data available for reading and doesn't "know" where are things
actually located).
Note that this method only load plug-ins to this manager but not activate
them. Call
PluginManager.activatePlugin(String) method to make plug-in
activated. It is recommended to do this immediately before first plug-in
use.
Parameters: locations - plug-in locations data map where keys are manifest URL's and values are registeredplug-ins or plug-in fragments, URL's for unprocessed manifestsare not included throws: JpfException - if given plug-ins can't be registered or published (optionalbehavior) See Also:org.java.plugin.registry.PluginDescriptor See Also:org.java.plugin.registry.PluginFragment
Registers plug-in manager event listener. If given listener has been
registered before, this method will throw an
IllegalArgumentException .
Parameters: listener - new manager event listener
Shuts down the framework.
Calling this method will deactivate all active plug-ins in order, reverse
to the order they was activated. It also releases all resources allocated
by this manager (class loaders, plug-in descriptors etc.). All disabled
plug-ins will be marked as "enabled", all registered event listeners will
be unregistered.
Starts given plug-in. Simply forward call to
Plugin.doStart method.
Parameters: plugin - plug-in to be started throws: Exception - if any error has occurred during plug-in start
Stops given plug-in. Simply forward call to
Plugin.doStop method.
Parameters: plugin - plug-in to be stopped throws: Exception - if any error has occurred during plug-in stop
Unregisters manager event listener. If given listener hasn't been
registered before, this method will throw an
IllegalArgumentException .
Parameters: listener - registered listener