org.objectweb.easybeans.enhancer
Class Enhancer

java.lang.Object
  extended by org.objectweb.easybeans.enhancer.Enhancer

public class Enhancer
extends java.lang.Object

This class is used for enhancing a set of classes (Beans like Stateless, Stateful, MDB, etc).

Author:
Florent Benoit

Field Summary
private  EjbJarAnnotationMetadata ejbJarAnnotationMetadata
          Metadata of the classes of a given ejb-jar.
private  java.lang.ClassLoader loader
          Classloader used to load/define classes.
private static JLog logger
          Logger.
 
Constructor Summary
Enhancer(java.lang.ClassLoader loader, EjbJarAnnotationMetadata ejbJarAnnotationMetadata)
          Creates an new enhancer.
 
Method Summary
 void enhance()
          Enhance all classes which match beans, etc.
private  org.objectweb.asm.ClassReader getClassReader(ClassAnnotationMetadata classAnnotationMetadata)
          Gets a class reader for a given metadata.
private static void loadClass(java.lang.String className, byte[] b)
          Loads/defines a class in the current class loader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static JLog logger
Logger.


ejbJarAnnotationMetadata

private EjbJarAnnotationMetadata ejbJarAnnotationMetadata
Metadata of the classes of a given ejb-jar.


loader

private java.lang.ClassLoader loader
Classloader used to load/define classes.

Constructor Detail

Enhancer

public Enhancer(java.lang.ClassLoader loader,
                EjbJarAnnotationMetadata ejbJarAnnotationMetadata)
Creates an new enhancer.

Parameters:
loader - classloader where to define enhanced classes.
ejbJarAnnotationMetadata - object with references to the metadata.
Method Detail

enhance

public void enhance()
             throws EnhancerException
Enhance all classes which match beans, etc.

Throws:
EnhancerException - if enhancing fails

getClassReader

private org.objectweb.asm.ClassReader getClassReader(ClassAnnotationMetadata classAnnotationMetadata)
                                              throws EnhancerException
Gets a class reader for a given metadata.

Parameters:
classAnnotationMetadata - given metadata
Returns:
classreader associated to the given metadata
Throws:
EnhancerException - if no classWriter can be returned

loadClass

private static void loadClass(java.lang.String className,
                              byte[] b)
Loads/defines a class in the current class loader.

Parameters:
className - the name of the class
b - the bytecode of the class to define