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

org.zeroturnaround.javarebel.integration.oc4j.EJBPackageDeploymentCBP Maven / Gradle / Ivy

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

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

/**
 * Transforms com.evermind.server.ejb.EJBPackageDeployment
 * to enable rebel.xml for EJBs in OC4J container.
 * 
 * @author Rein Raudjärv
 */
public class EJBPackageDeploymentCBP extends JavassistClassBytecodeProcessor {

  public void process(ClassPool cp, ClassLoader cl, CtClass ctClass) throws Exception {
    cp.importPackage("org.zeroturnaround.javarebel");
    
    try {
      ctClass.getDeclaredMethod("addModuleCodeSource").insertAfter(
          "{ " + 
          "  IntegrationFactory.getInstance().reinitializeClassLoader(getEJBClassLoader());" +
          "}");
    } catch (NotFoundException e) { /* skip */ }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy