Class RebaseImplementationTarget

  • All Implemented Interfaces:
    Implementation.Target

    public class RebaseImplementationTarget
    extends Implementation.Target.AbstractBase
    An implementation target for redefining a given type while preserving the original methods within the instrumented type.

     

    Super method calls are merely emulated by this Implementation.Target in order to preserve Java's super call semantics a user would expect when invoking a super-prefixed method. This means that original methods are either moved to renamed private methods which are never dispatched virtually or they are invoked directly via the INVOKESPECIAL invocation to explicitly forbid a virtual dispatch.
    • Method Detail

      • of

        protected static Implementation.Target of​(TypeDescription instrumentedType,
                                                  MethodGraph.Linked methodGraph,
                                                  ClassFileVersion classFileVersion,
                                                  MethodRebaseResolver methodRebaseResolver)
        Creates a new rebase implementation target.
        Parameters:
        instrumentedType - The instrumented type.
        methodGraph - A method graph of the instrumented type.
        classFileVersion - The type's class file version.
        methodRebaseResolver - A method rebase resolver to be used when calling a rebased method.
        Returns:
        An implementation target for the given input.
      • invokeSuper

        public Implementation.SpecialMethodInvocation invokeSuper​(MethodDescription.SignatureToken token)
        Description copied from interface: Implementation.Target
        Creates a special method invocation for invoking the super method of the given method.
        Parameters:
        token - A token of the method that is to be invoked as a super method.
        Returns:
        The corresponding special method invocation which might be illegal if the requested invocation is not legal.
      • getOriginType

        public TypeDescription getOriginType()
        Description copied from interface: Implementation.Target
        Identifies the origin type of an implementation. The origin type describes the type that is subject to any form of enhancement. If a subclass of a given type is generated, the base type of this subclass describes the origin type. If a given type is redefined or rebased, the origin type is described by the instrumented type itself.
        Returns:
        The origin type of this implementation.