Skip to end of metadata
Go to start of metadata

The Taverna 2 workbench is started in separate stages.

The module t2workbench/application contains the Maven assembly file to put together the release of the Taverna 2 workbench application as a zip-file, and a few files that will be in the application folder.

After running mvn assembly:directory you should in t2workbench/application/target/application-0.1-SNAPSHOT-bin.dir/application-0.1-SNAPSHOT find these files:

The run scripts contain a single line to start the workbench:

This will set the BootstrapClassLoader to our own implementation that has a public addURL() method, and launches the main method of PreLauncher.

PreLauncher

PreLauncher and the prelauncher module does not have much responsibility except to build the classpath for launching the Launcher, which we'll come back to.

The prelauncher will find all *jar files in lib/ and add them to the BootstrapClassLoader - effectively adding them to the classpath. It will also add the lib/ directory itself, allowing the log4j.properties file to be picked up by log4j. The PreLauncher then uses the bootstrap class loader (available through getLaunchingClassLoader() ) to find the launcher class net.sf.taverna.raven.launcher.Launcher and runs it's main method.

The PreLauncher also exposes a method addURLToClassPath() which is later used by the Plugin manager when setting the system artifacts using Bootstrap.addSystemArtifact() - note that these are the system artifacts marked as system=true in plugins.xml - not the kind of system artifacts presented to Raven.

If the PreLauncher was launched without the java.system.class.loader set to the BootstrapClassLoader, it will still make an instance of BootstrapClassLoader and use this to find the Launcher, the Launcher will set the current context thread loader to this instance, so that the system=true artifacts would still work for most third party libraries.

The last responsibility for the pre launcher module is within BootstrapLocation, which only task is to discover where it exists - ie. where the JAR file is located. This is used by the PreLauncher to know where to find the other jar files, but also by the Launcher (through the ApplicationConfig) for where to find the conf/plugins.xml etc.

So, as we remember, the PreLauncher has found the Launcher class and invoked it's main method. Remember that we are still running outside Raven, but we know have a "rich" classpath including Raven, the plugin manager, log4j and the launcher.

Launcher

The Launcher is responsible for starting the plugin manager and the Raven repository, and using it to find the instance of the interface Launchable as specified in the file conf/raven-launcher.properties - which would generally be . It also prepares the context class loader as explained above, and starts the splash screen (picking up launcher_splashscreen.png from the classpath prepared by the PreLauncher). 

The launcher draws most of its expertise from the plugin manager, a Raven SPI registry and the appconfig duo of ApplicationConfig and ApplicationRuntime.

ApplicationConfig and ApplicationRuntime

ApplicationConfig is the class that reads the raven-launcher.properties file from the conf/ directory to expose the configuration of the Launcher.

(Actually it is searching quite vigorously:

  • $startup/conf/$resourceName
  • $startup/$resourceName
  • $contextClassPath/conf/$resourceName
  • $contextClassPath/$resourceName
  • $classpath/conf/$resourceName
  • $classpath/$resourceName

)

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.