...
- The java standard for Plugins is OSGi (http://www.osgi.org), this is what IGB (written in java) uses.
- the OSGi term for a Plugin is Bundle, they mean the same thing.
- an OSGi bundle is a jar file. It must have a MANIFEST.MF file with the OSGi headers (see below).
- an OSGi bundle can (usually will) have a special java class called an Activator. This class must extend
org.osgi.framework.BundleActivator
, and implement thestart()
andstop()
methods. The activator class is specified in the Bundle-Activator MANIFEST.MF header (see below). These methods are called when the bundle is started and stopped. - when a program is running with OSGi, the OSGi framework dynamically handles installing / uninstalling,
activating (starting), deactivating (stopping), and upgrading bundles. - OSGi caches bundles, saving them to a directory on the local hard disk, so that they don't need to be downloaded every time. So you can work offline after you have loaded IGB. If, for some reason, you need to clean out the bundle cache, you can run
ant cbc
(clear bundle cache). - There are several implementations of OSGi, including:
- Apache Felix (http://felix.apache.org/)
- Eclipse Equinox (http://www.eclipse.org/equinox/)
- Knoplerfish (http://www.knopflerfish.org/)
- the implementations are (for the most part) interchangeable and are free
- the implementations allow the user to run OSGi from a command line tool or to start it within a program
- IGB starts the felix implementation from within the com.affymetrix.igb.main.OSGiHandler class, but IGB can
be run using the Felix command line tool by runningant gogo
- there are several tutorials for OSGi, including:
- How to get Started with OSGi (http://www.osgi.org/About/HowOSGi)
- Apache Felix OSGi Tutorial (http://felix.apache.org/site/apache-felix-osgi-tutorial.html)
- OSGi for Beginners (http://www.theserverside.com/news/1363825/OSGi-for-Beginners)
- OSGi with Eclipse Equinox - Tutorial (http://www.vogella.de/articles/OSGi/article.html)
- IGB uses OBR (http://felix.apache.org/site/apache-felix-osgi-bundle-repository.html) to find and load bundles from web servers (repositories). The web servers need to use OBR to create the repository.xml file listing all the available bundles.
- Users can add / remove bundle repositories on the Preferences by choosing File>Preferences page. which tab?
- IGB uses OSGi Services to allow bundles to add new implementations of existing IGB elements. The new implementations will show up as soon as the bundle is started. Examples are the include IGB tabs and the graph manimpulation functions.
Developing IGB bundles
...
- Now, compile and jar these files into MyTransformer.jar (the jar command has a -m option for the manifest file).
- At this point, you want to put your jar into a web server using OBR (see above).
- To add the plugin to a web server without OBR, in the plugins directory, from the command line run
java -cp IGB_HOME/igb_server/lib/bindex.jar -jar bindex.jar -n IGB -q -r repository.xml .
- where IGB_HOME is your IGB directory.checked-out copy of the genoviz-trunk repository from Sourceforge.net.
- ... can we delete this?
- Once you have installed your bundle, select a graph track on the main view, and open the Graph Adjuster tab. Now if you click on the Transformation drop down, you will see
MyTransformer
in the list. Select it and click theGo
button, and you will see a new track using your bundle.
...