Runtime
Wrap any interface instance at runtime with pre/post actions, security rules, metrics and virtual proxy strategies. Built on JDK dynamic proxies.
DynamicProxyBuilder →One API, two strategies. JDK dynamic proxies at runtime, generated static proxies at compile time — no AOP framework required.
Service proxy = DynamicProxyBuilder
.createBuilder(Service.class, new ServiceImpl())
.addIPreAction((original, method, args) -> {
// executed before every invocation
})
.addSecurityRule(() -> currentUserCanCallService())
.addMetrics()
.build();@StaticLoggingProxy
public interface Service {
String work(String input);
}
// Generated at compile time — zero reflection at runtime
ServiceStaticLoggingProxy proxy =
new ServiceStaticLoggingProxy()
.withDelegator(new ServiceImpl());Wrap any interface instance at runtime with pre/post actions, security rules, metrics and virtual proxy strategies. Built on JDK dynamic proxies.
DynamicProxyBuilder →Generate proxy classes during build through annotation processing. Zero reflection at runtime, GraalVM native-image-ready, JPMS-compliant.
@StaticLoggingProxy →Hook before and after every invocation without touching the implementation.
Block calls declaratively. Rule returns false, the proxy refuses the call.
Method timings, JMX reporting, console reporting — wired through one builder call.
Lazy creation strategies for expensive interface implementations.
Compose before, around and after in a single processor.
Extend BasicStaticProxyAnnotationProcessor for your own annotations.