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

org.zeroturnaround.javarebel.integration.IntegrationPlugin Maven / Gradle / Ivy

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

import org.zeroturnaround.javarebel.ClassResourceSource;
import org.zeroturnaround.javarebel.IntegrationFactory;
import org.zeroturnaround.javarebel.Plugin;
import org.zeroturnaround.javarebel.integration.confluence.JarClassLoaderCBP;
import org.zeroturnaround.javarebel.integration.eclipse301.Eclipse301DefaultClassLoaderClassBytecodeProcessor;
import org.zeroturnaround.javarebel.integration.elcommons.BeanInfoManagerClassBytecodeProcessor;
import org.zeroturnaround.javarebel.integration.equinox.EquinoxClassPathManagerClassBytecodeProcessor;
import org.zeroturnaround.javarebel.integration.equinox.EquinoxDefaultClassLoaderClassBytecodeProcessor;
import org.zeroturnaround.javarebel.integration.generic.FindClassClassBytecodeProcessor;
import org.zeroturnaround.javarebel.integration.intellij.IntelliJClassLoaderClassBytecodeProcessor;
import org.zeroturnaround.javarebel.integration.jboss5.BaseClassLoaderCBP;
import org.zeroturnaround.javarebel.integration.tomcat.WebappClassLoaderClassBytecodeProcessor;
import org.zeroturnaround.javarebel.integration.websphere.CompoundClassLoaderClassBytecodeProcessor;

/**
 * @author ekabanov
 * @see http://www.csg.is.titech.ac.jp/~chiba/javassist/tutorial/tutorial2.html
 */
public class IntegrationPlugin implements Plugin {
	public void preinit() {    
		String[] standardIntegrationClassLoaders = new String[]{
				// TOMCAT
				"org.apache.catalina.loader.StandardClassLoader",
				// CAUCHO RESIN
				"com.caucho.loader.DynamicClassLoader",
				// JETTY
				"org.mortbay.jetty.webapp.WebAppClassLoader",
				// WEBLOGIC
				"weblogic.utils.classloaders.GenericClassLoader",
				// GLASSFISH
				"com.sun.enterprise.loader.EJBClassLoader",
				// GWT
				"com.google.gwt.dev.shell.CompilingClassLoader",
				// Oracle 9.0.4
				"com.evermind.naming.ContextClassLoader",
				// IBM WAS 6.1				
				"com.ibm.ws.bootstrap.ExtClassLoader"
		};

		IntegrationFactory.getInstance().addIntegrationProcessor(
				standardIntegrationClassLoaders, 
				new FindClassClassBytecodeProcessor());
		
		// TOMCAT 5.5
		
	    IntegrationFactory.getInstance().addIntegrationProcessor(
	            "org.apache.catalina.loader.WebappClassLoader", 
	            new WebappClassLoaderClassBytecodeProcessor());
		
		//	IBM WAS 6.1	
		
		IntegrationFactory.getInstance().addIntegrationProcessor(
				"com.ibm.ws.classloader.CompoundClassLoader", 
				new CompoundClassLoaderClassBytecodeProcessor());
		
		// Equinox (and Eclipse)

		IntegrationFactory.getInstance().addIntegrationProcessor(
				"org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader", 
				new EquinoxDefaultClassLoaderClassBytecodeProcessor());     

		IntegrationFactory.getInstance().addIntegrationProcessor(
				"org.eclipse.osgi.baseadaptor.loader.ClasspathManager", 
				new EquinoxClassPathManagerClassBytecodeProcessor()); 

		IntegrationFactory.getInstance().addIntegrationProcessor(
				"org.eclipse.osgi.framework.internal.defaultadaptor.DefaultClassLoader", 
				new Eclipse301DefaultClassLoaderClassBytecodeProcessor());
		
		// JBOSS 5
		IntegrationFactory.getInstance().addIntegrationProcessor(
				"org.jboss.classloader.spi.base.BaseClassLoader", 
				new BaseClassLoaderCBP());
		
		// IntelliJ IDEA

		IntegrationFactory.getInstance().addIntegrationProcessor(
				"com.intellij.util.lang.UrlClassLoader", 
				new IntelliJClassLoaderClassBytecodeProcessor());
		
		// Atlassian Confluence
    IntegrationFactory.getInstance()
    .addIntegrationProcessor(
        "com.atlassian.plugin.loaders.classloading.JarClassLoader", 
        new JarClassLoaderCBP());
		
		// commons-el
		IntegrationFactory.getInstance().addIntegrationProcessor(
				new String[]{"org.apache.commons.el.BeanInfoManager",
						"org.apache.taglibs.standard.lang.jstl.BeanInfoManager"
				}, 
				new BeanInfoManagerClassBytecodeProcessor());
	}

  public boolean checkDependencies(ClassLoader cl, ClassResourceSource crs) {
    return false;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy