Domanda

I'm invoking third party code

method.invoke(null, args);

and it has a classloader that loads a class. Is it possible that I can prevent it from loading a specific class? Also There is more than one third part program that I am invoking and I am looking for a broad solution that will just generally prevent the child classloaders from loading a specific class, seeing as how child classloaders delegate to the parent first is this possible?

È stato utile?

Soluzione

Ok after some plugging around I figured out a way to do this, javaagent option, this is an example to intercept all incoming class files, which is what I wanted. This is commonly used in things like memory profilers.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top