-
Notifications
You must be signed in to change notification settings - Fork 3
JSim Plugin Guide
This document describes how to write JSim plugins, code modules that extend JSim's functionality at run-time. Familiarity with both JSim and Java software engineering is assumed.
Contents:
- TODO
A JSim plugin is a Java archive (.jar file) that is loaded into jsim, jsbatch or jsserver at run-time to enhance functionality for some user purpose. For example, a user might wish to output model data in a format not currently provided by JSim. This format may be peculiar to a the user's current project, but of little value to the general JSim user community. Here a JSim plugin provides the advantages:
- the public JSim distribution is not weighed down with code specific to a single user;
- the user may implement the plugin without waiting for the JSim development team to allocate time for his particular project.
A plugin's type determines the sort of functionality the plugin will have within JSim. The example above is of the DataFormat type. A plugin's variant is a unique name for the plugin, within all available plugins of the same type. Suppose the example above was implemented via a plugin MyDataFormat.jar, with type DataFormat and variant "mine". Below, the plugin is loaded via the jsbatch -plugin switch, and accessed via the -ofmt switch:
jsbatch -f some.proj -plugin MyDataFormat.jar -ofmt mine
Note that -ofmt flag does not normally accept "mine" as a valid format. However, with the plugin "mine" becomes acceptable (and functional).
JSim has a client-server architecture, and plugins may enhance either the client or server operation. When (as by default) jsim or jsbatch is run using the local server, either type of plugin will be operational. When running the JSim applet or running jsim or jsbatch on a remote server, only client-side plugins will be operational. Remote server-side plugins must be installed via jsserver.
For each type of plugin, there is an associated JSim internal class which implements that functionality. For example, the JSim.data.DataFormat class implements the functionality of the plugin type DataFormat. The plugin .jar file must contain a new subclass of the internal class. In our example MyDataFormat extends JSim.data.DataFormat. The new subclass, along with supporting classes and resources are bundled into the plugin .jar. The manifest for a plugin .jar must have the following entries that allow JSim to recognize the plugin and use is appropriately. Values for each entry correspond to the above example:
JSimPluginType: DataFormat
JSimPluginVariant: mine
JSimPluginClass: MyDataFormat
The plugin classes may be compiled against the JSimClient and JSimServer distributed jar files found in $JSIMHOME/lib. A client-side plugin will need only JSimClient.jar, a server-side plugin will need both.
Details for plugin programming may be found in the JSim Public API .
See $JSIMHOME/doc/plugins in your JSim distribution for some examples of JSim plugins and how to build them (on a Macintosh, the doc directory is in the installation directory). More complete documentation for plugin programming may be found in the JSim Public API .
Model development and archiving support at physiome.org provided by the following grants: NIH U01HL122199 Analyzing the Cardiac Power Grid, 09/15/2015 - 05/31/2020, NIH/NIBIB BE08407 Software Integration, JSim and SBW 6/1/09-5/31/13; NIH/NHLBI T15 HL88516-01 Modeling for Heart, Lung and Blood: From Cell to Organ, 4/1/07-3/31/11; NSF BES-0506477 Adaptive Multi-Scale Model Simulation, 8/15/05-7/31/08; NIH/NHLBI R01 HL073598 Core 3: 3D Imaging and Computer Modeling of the Respiratory Tract, 9/1/04-8/31/09; as well as prior support from NIH/NCRR P41 RR01243 Simulation Resource in Circulatory Mass Transport and Exchange, 12/1/1980-11/30/01 and NIH/NIBIB R01 EB001973 JSim: A Simulation Analysis Platform, 3/1/02-2/28/07.