org.objectweb.fractal.julia.loader
Class DynamicLoader

java.lang.Object
  extended byorg.objectweb.fractal.julia.loader.BasicLoader
      extended byorg.objectweb.fractal.julia.loader.DynamicLoader
All Implemented Interfaces:
Loader

public class DynamicLoader
extends BasicLoader

Provides an implementation of the Loader interface that can generate classes on the fly.

Requirements


Constructor Summary
DynamicLoader()
           
 
Method Summary
protected  Class generateClass(String name, Tree classDescriptor)
          Generates the class whose descriptor is given, with the given name.
 Class loadClass(String name)
          Loads the class whose name is given.
 
Methods inherited from class org.objectweb.fractal.julia.loader.BasicLoader
evalTree, loadClass, loadTree, newObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicLoader

public DynamicLoader()
Method Detail

loadClass

public Class loadClass(String name)
                throws ClassNotFoundException
Description copied from interface: Loader
Loads the class whose name is given.

Specified by:
loadClass in interface Loader
Overrides:
loadClass in class BasicLoader
Throws:
ClassNotFoundException

generateClass

protected Class generateClass(String name,
                              Tree classDescriptor)
                       throws ClassNotFoundException
Description copied from class: BasicLoader
Generates the class whose descriptor is given, with the given name. The generated class must implement the Generated interface, and its getFcGeneratorParameters method must return classDescriptor.toString(). The default implementation of this method throws an exception.

Overrides:
generateClass in class BasicLoader
Parameters:
name - the name of the class to be generated.
classDescriptor - the descriptor of the class to be generated. This descriptor must be of the form "(objectDescriptor arg1 ... argN)" (see loadClass).
Returns:
a class named name and whose content is described by the given class descriptor.
Throws:
ClassNotFoundException - if a problem occurs during the generation of the class.