final Environment environment = CurrentEnvironment.getEnvironment();
if (integrationClassTriggers.containsKey(className)) {
integrationClassloader.add(loader);
// we need to load the class in another thread
// otherwise it will not go through the javaagent
final Extension extension = integrationClassTriggers.get(className);
if (!loadedClassChangeAwares.contains(extension.getClassChangeAwareName())) {
loadedClassChangeAwares.add(extension.getClassChangeAwareName());
try {
Class<?> clazz = Class.forName(extension.getClassChangeAwareName(), true, loader);
final Object intance = clazz.newInstance();
if (intance instanceof ClassChangeAware) {
ClassChangeNotifier.instance().add((ClassChangeAware) intance);
}
final String newEnv = extension.getEnvironment();
if (newEnv != null) {
final Class<?> envClass = Class.forName(newEnv, true, loader);
final Environment newEnvironment = (Environment) envClass.newInstance();
if (environment instanceof DefaultEnvironment) {
CurrentEnvironment.setEnvironment(newEnvironment);