org.ow2.easybeans.api.loader
Interface EZBClassLoader


public interface EZBClassLoader

Interface of an EasyBeans classloader which allow to add class transformers and class definitions.

Author:
Florent Benoit

Method Summary
 void addClassDefinition(String className, byte[] bytecode)
          Adds the bytecode for a given class.
 void addTransformer(javax.persistence.spi.ClassTransformer transformer)
          Add a transformer supplied by the provider that will be called for every new class definition or class redefinition that gets loaded by the loader returned by the PersistenceInfo.getClassLoader method.
 ClassLoader duplicate()
          Creates and returns a copy of this object.
 

Method Detail

addClassDefinition

void addClassDefinition(String className,
                        byte[] bytecode)
Adds the bytecode for a given class. It will be used when class will be loaded.

Parameters:
className - the name of the class.
bytecode - the bytes of the given class.

addTransformer

void addTransformer(javax.persistence.spi.ClassTransformer transformer)
Add a transformer supplied by the provider that will be called for every new class definition or class redefinition that gets loaded by the loader returned by the PersistenceInfo.getClassLoader method. The transformer has no effect on the result returned by the PersistenceInfo.getTempClassLoader method. Classes are only transformed once within the same classloading scope, regardless of how many persistence units they may be a part of.

Parameters:
transformer - A provider-supplied transformer that the Container invokes at class-(re)definition time

duplicate

ClassLoader duplicate()
Creates and returns a copy of this object. It is used for example when Persistence Provider needs a new Temp classloader to load some temporary classes.

Returns:
a copy of this object


Copyright © 2006-2012 OW2 Consortium. All Rights Reserved.