Interface InstrumentableClassLoader


  • public interface InstrumentableClassLoader
    Providers of class loaders for GlassFish applications can optionally implements this interface to indicate their class loader is capable of byte code enhancement.
    Author:
    Persistence Team
    • Method Detail

      • copy

        ClassLoader copy()
        Create and return a temporary loader with the same visibility as this loader. The temporary loader may be used to load resources or any other application classes for the purposes of introspecting them for annotations. The persistence provider should not maintain any references to the temporary loader, or any objects loaded by it.
        Returns:
        A temporary classloader with the same classpath as this loader
      • addTransformer

        void addTransformer​(ClassFileTransformer transformer)
        Add a new ClassFileTransformer to this class loader. This transfomer should be called for each class loading event.
        Parameters:
        transformer - new class file transformer to do byte code enhancement.