Package er.profiling

Source Code of er.profiling.PFProfilerBootstrap

package er.profiling;

import java.net.URLClassLoader;

import er.profiling.classloader.WeavingClassLoader;


public class PFProfilerBootstrap {
  private static boolean premainHasRun = false;
 
  public static void premain(String[] args) {
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    if (cl instanceof URLClassLoader && !premainHasRun) {
      premainHasRun = true;
      System.setProperty(WeavingClassLoader.GLUE_NAME_KEY, PFProfilerMixin.class.getName());
      URLClassLoader loader = (URLClassLoader) cl;
      ClassLoader newCl = new WeavingClassLoader(loader.getURLs(), loader.getParent());
      Thread.currentThread().setContextClassLoader(newCl);
    }
  }
}
TOP

Related Classes of er.profiling.PFProfilerBootstrap

TOP
Copyright © 2018 www.massapi.com. 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.