I was in the impression that whenever a class implements an interface then JDK based proxies are created.
I have a bean which implements an interface with prototype scope which is injected in a bean with singleton scope. I tried using proxyMode = ScopedProxyMode.INTERFACES JDK proxy was created which is right, but when I tired proxyMode = ScopedProxyMode.TARGET_CLASS then CGLIB based proxy is created even though my bean implements an interface.
what happens when
proxyMode = ScopedProxyMode.TARGET_CLASS
and
proxyMode = ScopedProxyMode.INTERFACES
what is the difference between them? when to use which one?
One more question I have is what is the correct way to inject prototype bean into singleton bean?