Package de.petris.dynamicaspects.wrapper

Examples of de.petris.dynamicaspects.wrapper.CallWrapperMethodPatcher


    List<CallMatch> targets =
      searcher.lookUpMethodCall(
          Pattern.compile( joinpointPattern ) );
   
    // a patcher for the given method
    CallWrapperMethodPatcher mp =
      new CallWrapperMethodPatcher(
        methodIdx, mGen, constPoolGen,
        joinpointPattern, targets );

    // get the new method without the wrapper
    targetClass.getMethods()[methodIdx] =
      mp.deinstall();
     
    // and update the class because of this change
     targetClass.setConstantPool(
       constPoolGen.getFinalConstantPool() );
  }
View Full Code Here


          "with index %s and pattern %s",
          mGen.getName(), methodIdx,
          joinpointPattern.pattern() );
       
        // install the wrapper to the method
        CallWrapperMethodPatcher mp =
          new CallWrapperMethodPatcher(
            methodIdx.intValue(), mGen, constPoolGen,
            joinpointPattern.pattern(), targets );

        // install the advice to the wrapper
        cWrapper.install( (BeforeAfterAdvice)advice );
       
        // create mapping: method->joinpointPattern->wrapper
        callWrappers.get( methodIdx ).put(
            joinpointPattern.pattern(), cWrapper );
       
        // get the new method and replace the old version
        targetClass.getMethods()[methodIdx.intValue()] =
          mp.install();
          
        // and update the class because of this change
         targetClass.setConstantPool(
           constPoolGen.getFinalConstantPool() );
      }
View Full Code Here

TOP

Related Classes of de.petris.dynamicaspects.wrapper.CallWrapperMethodPatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.