The Java Plug-in API utilizes standard JAR files to contain the plug-in code and any plug-in resources. Plug-in files do not however have to have the .jar
extension. Any or no extension can be used, though .plug
is recommended. In addition the JAR file must contain a plug-in information file and the classes contained in the file must conform to the Java Plug-in API constraints.
JAR files normally contain a manifest file stored under the pathname META-INF/MANIFEST.MF
. In addition, in order for the JAR file to be a valid Java Plug-in API file it must contain a plug-in information file. The plug-in information file must have the path META-INF/PLUG-IN.XML
and conform to the plug-in information file specification.
In addition to containing a Java Plug-in API information file the class specified as the plug-in class in the information file must adhere to the following constraints:
load()
- invoked after the class is instantiated as it is being loadedload(Plug-in descriptor)
- invoked instead of the other load method, provides the plug-in's descriptor allowing it to introspectunload()
- invoked when someone calls unload on the plug-in descriptor objectsetPluginResourceLoader(ResourceLoader)
- provides the plug-in with a resource loader to access resources contained in its plug-in filejwalker@cs.oberlin.edu |