Class PCClassFileTransformer

  • All Implemented Interfaces:
    java.lang.instrument.ClassFileTransformer
    Direct Known Subclasses:
    PCClassFileTransformer.Reentrant

    public class PCClassFileTransformer
    extends java.lang.Object
    implements java.lang.instrument.ClassFileTransformer
    Transformer that makes persistent classes implement the PersistenceCapable interface at runtime.
    Author:
    Abe White
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static PCClassFileTransformer newInstance​(MetaDataRepository repos, Options parseProperties, java.lang.ClassLoader tmpLoader)  
      byte[] transform​(java.lang.ClassLoader loader, java.lang.String className, java.lang.Class redef, java.security.ProtectionDomain domain, byte[] bytes)  
      protected byte[] transform0​(java.lang.String className, java.lang.Class redef, byte[] bytes)
      We have to split the transform method into two methods to avoid ClassCircularityError when executing method using pure-JIT JVMs such as JRockit.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.instrument.ClassFileTransformer

        transform
    • Constructor Detail

      • PCClassFileTransformer

        public PCClassFileTransformer​(MetaDataRepository repos,
                                      Options opts,
                                      java.lang.ClassLoader loader)
        Constructor.
        Parameters:
        repos - metadata repository to use internally
        opts - enhancer configuration options
        loader - temporary class loader for loading intermediate classes
      • PCClassFileTransformer

        public PCClassFileTransformer​(MetaDataRepository repos,
                                      PCEnhancer.Flags flags,
                                      java.lang.ClassLoader tmpLoader,
                                      boolean devscan)
        Constructor.
        Parameters:
        repos - metadata repository to use internally
        flags - enhancer configuration
        tmpLoader - temporary class loader for loading intermediate classes
        devscan - whether to scan the dev classpath for persistent types if none are configured
    • Method Detail

      • transform

        public byte[] transform​(java.lang.ClassLoader loader,
                                java.lang.String className,
                                java.lang.Class redef,
                                java.security.ProtectionDomain domain,
                                byte[] bytes)
                         throws java.lang.instrument.IllegalClassFormatException
        Specified by:
        transform in interface java.lang.instrument.ClassFileTransformer
        Throws:
        java.lang.instrument.IllegalClassFormatException
      • transform0

        protected byte[] transform0​(java.lang.String className,
                                    java.lang.Class redef,
                                    byte[] bytes)
                             throws java.lang.instrument.IllegalClassFormatException
        We have to split the transform method into two methods to avoid ClassCircularityError when executing method using pure-JIT JVMs such as JRockit.
        Throws:
        java.lang.instrument.IllegalClassFormatException