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

org.zeroturnaround.javarebel.integration.jetty.JettyServletHandlerClassBytecodeProcessor Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
package org.zeroturnaround.javarebel.integration.jetty;

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

public class JettyServletHandlerClassBytecodeProcessor extends
    JavassistClassBytecodeProcessor {
  
  public void process(ClassPool cp, ClassLoader cl, CtClass ctClass) throws Exception {
    CtMethod m = ctClass.getMethod("initialize", "(Lorg/mortbay/http/HttpContext;)V");
    m.insertAfter(
        "org.zeroturnaround.javarebel.ServletIntegrationFactory.getInstance()" +
        "    .registerServletContext((" + RebelServletContext.class.getName() + ") $0.getServletContext());");
    
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy