So if I understand correctly the jdk dynamic proxies works kinda like this if the target implements any interface (does that include abstract classes?):
interface SomeInterface {
void proxiedMethod();
}
class Target implements SomeInterface {
@Override
public void proxiedMethod() {
// some implementation
}
}
and then the proxy looks something like this (completely guessing here lol):
class Proxy implements SomeInterface {
private final Target target = ...; // actual class to be proxied
@Override
public void proxiedMethod() {
// some additional logic before calling
target.proxiedMethod();
// some additional logic after calling
}
}
and then if it doesnt implement an interface:
class Target {
public void proxiedMethod() {
// some implementation
}
}
and then the proxy using cglib is going to be a subclass if it instead of "wrapping":
class Proxy extends Target {
@Override
public void proxiedMethod() {
// some additional logic before calling
super.proxiedMethod();
// some additional logic after calling
}
}
