org.objectweb.easybeans.client
Class ClientEnhancer

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

public class ClientEnhancer
extends Enhancer

/** This enhancer is used by the client container to enhance client classes. For example, it will allow to use @EJB annotations, etc.

Author:
Florent Benoit

Field Summary
private static JLog logger
          Logger.
 
Constructor Summary
ClientEnhancer(java.lang.ClassLoader loader, EjbJarAnnotationMetadata ejbJarAnnotationMetadata, java.util.Map<java.lang.String,java.lang.Object> map)
          Creates an new enhancer.
 
Method Summary
 void enhance()
          Override the super class method by using only the injection adapter.
static void enhance(java.lang.ClassLoader loader, java.util.List<java.lang.String> classesToEnhance, java.util.Map<java.lang.String,java.lang.Object> map)
          Allow to enhance a given set of classes.
private static void read(java.lang.String className, java.lang.ClassLoader loader, ScanClassVisitor scanVisitor, EjbJarAnnotationMetadata ejbJarAnnotationMetadata)
          Visits the given class and all available parent classes.
 
Methods inherited from class org.objectweb.easybeans.enhancer.Enhancer
defineClass, enhanceSuperClass, getClassLoader, getClassReader, getEjbJarAnnotationMetadata, getMap
 
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.

Constructor Detail

ClientEnhancer

public ClientEnhancer(java.lang.ClassLoader loader,
                      EjbJarAnnotationMetadata ejbJarAnnotationMetadata,
                      java.util.Map<java.lang.String,java.lang.Object> map)
Creates an new enhancer.

Parameters:
loader - classloader where to define enhanced classes.
ejbJarAnnotationMetadata - object with references to the metadata.
map - a map allowing to give some objects to the enhancer.
Method Detail

enhance

public static void enhance(java.lang.ClassLoader loader,
                           java.util.List<java.lang.String> classesToEnhance,
                           java.util.Map<java.lang.String,java.lang.Object> map)
                    throws EnhancerException
Allow to enhance a given set of classes.

Parameters:
loader - the classloader that will be used to load the classes.
classesToEnhance - the set of classes to enhance
map - a map allowing to give some objects to the enhancer.
Throws:
EnhancerException - if enhancer fails

read

private static void read(java.lang.String className,
                         java.lang.ClassLoader loader,
                         ScanClassVisitor scanVisitor,
                         EjbJarAnnotationMetadata ejbJarAnnotationMetadata)
                  throws EnhancerException
Visits the given class and all available parent classes.

Parameters:
className - the class to visit.
loader - the classloader to use.
scanVisitor - the ASM visitor.
ejbJarAnnotationMetadata - the structure containing class metadata
Throws:
EnhancerException - if class can't be analyzed.

enhance

public void enhance()
             throws EnhancerException
Override the super class method by using only the injection adapter.

Overrides:
enhance in class Enhancer
Throws:
EnhancerException - if the class can't be enhanced.