|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.virtuosotechnologies.lib.plugin.SimpleFramework
A simple implementation of Framework. This implementation is for systems in which all plugins exist within the same Java VM (that is, a non-distributed system). The plug method uses the current thread to perform all plugin initialization.
This class is synchronized and thread-safe. Note, however, that Framework is generally not designed to be re-entrant (e.g. you can't have two calls to plug() happening simultaneously, whether in the same or different threads.)
Field Summary |
Fields inherited from interface com.virtuosotechnologies.lib.plugin.Framework |
CONTINUE_ON_DUPLICATE_PLUGINS_PROPERTY, CONTINUE_ON_SUPPRESSED_PLUGINS_PROPERTY, CURRENT_FRAMEWORK_APIVERSION |
Constructor Summary | |
SimpleFramework()
Constructor. |
Method Summary | |
void |
addFrameworkProgressListener(FrameworkProgressListener listener)
Register a listener on the Framework. |
ObjectSet |
getAvailableAPINames()
Get the names of the currently available APIs as an ObjectSet of Strings. |
ObjectSet |
getAvailableAPIVersions(String name)
Get the names of the currently available versions of the given API as an ObjectSet of Strings. |
ObjectSet |
getPluginIDSet()
Get the ids of the currently available plugins as an ObjectSet of PluginIDs. |
PluginInfo |
getPluginInfo(PluginID plugin)
Get the PluginInfo object for the given plugin. |
RequestablePropertySet |
getProperties()
Get properties of this Framework. |
PluginID |
getProvidingPluginFor(String name,
APIVersion version)
Get the PluginID of the plugin that provides the given API and version. |
void |
plug(PluginInfo[] infoArray)
Attempt to plug in the given Plugins. |
APIProvider |
provideAPI(Class cls,
APIVersion version,
String description,
Object impl)
Register an API with no providing plugin. |
void |
removeFrameworkProgressListener(FrameworkProgressListener listener)
Remove a listener on the Framework. |
void |
unplug(PluginID[] idArray)
Attempt to unplug in the given Plugins. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleFramework()
Method Detail |
public RequestablePropertySet getProperties()
getProperties
in interface Framework
public ObjectSet getPluginIDSet()
getPluginIDSet
in interface Framework
public PluginInfo getPluginInfo(PluginID plugin)
getPluginInfo
in interface Framework
plugin
- plugin id
public ObjectSet getAvailableAPINames()
getAvailableAPINames
in interface Framework
public ObjectSet getAvailableAPIVersions(String name)
getAvailableAPIVersions
in interface Framework
name
- name of API to query
public PluginID getProvidingPluginFor(String name, APIVersion version) throws APINotAvailableException
getProvidingPluginFor
in interface Framework
name
- name of API to queryversion
- version of API to query
APINotAvailableException
- the given api and version not provided.public APIProvider provideAPI(Class cls, APIVersion version, String description, Object impl) throws DuplicateAPIException
provideAPI
in interface Framework
cls
- interface classversion
- API versiondescription
- description Stringimpl
- implementation object
DuplicateAPIException
- the given API version already exists.public void plug(PluginInfo[] infoArray) throws PluginException
plug
in interface Framework
infoArray
- array of PluginInfo objects
PluginException
- couldn't start up the plugins
IllegalStateException
- a plug or unplug job is already in progresspublic void unplug(PluginID[] idArray) throws PluginException
unplug
in interface Framework
idArray
- array of name PluginIDs
PluginException
- couldn't shut down the plugins
IllegalStateException
- a plug or unplug job is already in progresspublic void addFrameworkProgressListener(FrameworkProgressListener listener)
addFrameworkProgressListener
in interface Framework
listener
- the listenerpublic void removeFrameworkProgressListener(FrameworkProgressListener listener)
removeFrameworkProgressListener
in interface Framework
listener
- the listener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |