All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zeroturnaround.javarebel.integration.weblogic.ChangeAwareClassLoaderCBP Maven / Gradle / Ivy

The newest version!
package org.zeroturnaround.javarebel.integration.weblogic;

import org.zeroturnaround.bundled.javassist.ClassPool;
import org.zeroturnaround.bundled.javassist.CtClass;
import org.zeroturnaround.bundled.javassist.CtNewMethod;
import org.zeroturnaround.javarebel.integration.support.JavassistClassBytecodeProcessor;

/**
 * Transforms weblogic.utils.classloaders.ChangeAwareClassLoader.
 * 
 * @author Rein Raudjärv
 */
public class ChangeAwareClassLoaderCBP extends JavassistClassBytecodeProcessor {

  public void process(ClassPool cp, ClassLoader cl, CtClass ctClass) throws Exception {
    // Can be overridden in sub-classes
    ctClass.addMethod(CtNewMethod.make(
        "protected boolean __isAlwaysUpToDate() { return true; }", ctClass));
    
    ctClass.getDeclaredMethod("upToDate").insertBefore(
        "{ if (__isAlwaysUpToDate()) { return true; } }");
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy