Friday, April 1, 2016

Spring Dynamic Proxy

When calling getBean("xxx");
What is the class of returned object?

If target Bean class implements any interface:
Spring uses jdk dynamic proxy, returns like com.sun.proxy.$Proxy2

If target Bean class does not implements any interface:
Spring uses CGLIB to return




No comments:

Post a Comment