org.kohsuke.file_leak_detector
Class Main

java.lang.Object
  extended by org.kohsuke.file_leak_detector.Main

public class Main
extends Object

Entry point for externally attaching agent into another local process.

Author:
Kohsuke Kawaguchi

Field Summary
 String options
           
 String pid
           
 
Constructor Summary
Main()
           
 
Method Summary
static void main(String[] args)
           
 void run()
           
protected  ClassLoader wrapIntoClassLoader(File toolsJar)
          Figures out how to load tools.jar into a classloader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pid

public String pid

options

public String options
Constructor Detail

Main

public Main()
Method Detail

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

run

public void run()
         throws Exception
Throws:
Exception

wrapIntoClassLoader

protected ClassLoader wrapIntoClassLoader(File toolsJar)
                                   throws MalformedURLException
Figures out how to load tools.jar into a classloader. The attachment API relies on JNI, so if we have other processes in the JVM that tries to use the attach API (like JavaMelody), it'll cause a failure. So we try to load tools.jar into the application classloadr so that later attempts to load tools.jar will see it.

Throws:
MalformedURLException


Copyright © 2014. All rights reserved.