Skip to content

Commit

Permalink
GH-1016 - Observability proxying now uses original bean class loader.
Browse files Browse the repository at this point in the history
  • Loading branch information
odrotbohm committed Jan 16, 2025
1 parent 2e31447 commit 32cebcb
Showing 1 changed file with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.lang.Nullable;
Expand All @@ -31,20 +30,10 @@
/**
* @author Oliver Drotbohm
*/
class ModuleObservabilitySupport implements BeanClassLoaderAware, BeanFactoryAware {
class ModuleObservabilitySupport implements BeanFactoryAware {

private ClassLoader classLoader;
private @Nullable AbstractAutoProxyCreator creator;

/*
* (non-Javadoc)
* @see org.springframework.beans.factory.BeanClassLoaderAware#setBeanClassLoader(java.lang.ClassLoader)
*/
@Override
public void setBeanClassLoader(ClassLoader classLoader) {
this.classLoader = classLoader;
}

/*
* (non-Javadoc)
* @see org.springframework.beans.factory.BeanFactoryAware#setBeanFactory(org.springframework.beans.factory.BeanFactory)
Expand Down Expand Up @@ -77,7 +66,7 @@ protected final Object addAdvisor(Object bean, Advisor advisor, Consumer<ProxyFa
customizer.accept(factory);
factory.addAdvisor(advisor);

return factory.getProxy(classLoader);
return factory.getProxy(bean.getClass().getClassLoader());
}
}

Expand Down

0 comments on commit 32cebcb

Please sign in to comment.