org.objectweb.fractal.adl
Class Launcher

java.lang.Object
  extended byorg.objectweb.fractal.adl.Launcher

public class Launcher
extends Object

A generic launcher to start a Fractal application from the name of a template definition.


Method Summary
static Parser getBootstrapParser()
          Returns the bootstrap parser component.
static void main(String[] args)
          Instantiates and starts the Fractal application described by the given template name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

main

public static void main(String[] args)
                 throws Exception
Instantiates and starts the Fractal application described by the given template name. Usage:

Launcher template [ itf ]

where template is the name of the template to be instantiated and started, and itf is the name of its Runnable interface.

This launcher initializes Fractal, constructs a composite parser component, uses it to parse the given template definition, instantiates the template component that just been parsed, starts the resulting component if it has a LifeCycleController interface, and starts a new thread to launch the application if the component provides a "run" interface of type Runnable.

Parameters:
args - the command line arguments.
Throws:
Exception - if a problem occurs.

getBootstrapParser

public static Parser getBootstrapParser()
                                 throws InstantiationException,
                                        NoSuchInterfaceException
Returns the bootstrap parser component. This component is created directly with the Fractal API (or even without it), since there is no pre existing parser component to create it from an XML template descriptor. Multiple calls to this method return the same component.

Returns:
the bootstrap parser component.
Throws:
InstantiationException - if the bootstrap parser cannot be created.
NoSuchInterfaceException - if the bootstrap type factory or generic factory interface cannot be found.