By Brennan Spies - Posted on August 22nd, 2011
Proxy4J is a Java library for creating proxies. The project has recently released a stable snapshot (I'm not going to consider it "1.0" until the remoting is done). I originally created Proxy4J as a spin-off from my development on Workhorse, mainly because I wasn't really satisfied with other libraries out there that do proxying (the Commons Proxy library was the closest I could find, but its inability to leverage Java 5+ made it a non-starter).
Proxy4J was designed to allow you to quickly create a proxy for any one of a number of common use cases:
Interceptors in particular are pretty slick: they allow you to keep a stack of MethodInterceptors (note that the library supports the AOP Alliance API), which are invoked in order prior to invoking the intercepted method. Proxy4J allows different underlying implementations, including CGLIB, Javassist, and the built-in proxying in the JDK itself.