Java 26 · EUPL-1.2 · JPMS

Proxies in Java — without the magic.

One API, two strategies. JDK dynamic proxies at runtime, generated static proxies at compile time — no AOP framework required.

Built since 2013 JDK 26 ready GraalVM-friendly MADE IN EU
Service proxy = DynamicProxyBuilder
    .createBuilder(Service.class, new ServiceImpl())
    .addIPreAction((original, method, args) -> {
      // executed before every invocation
    })
    .addSecurityRule(() -> currentUserCanCallService())
    .addMetrics()
    .build();

Two strategies, one mental model.

Runtime

Wrap any interface instance at runtime with pre/post actions, security rules, metrics and virtual proxy strategies. Built on JDK dynamic proxies.

DynamicProxyBuilder →

Compile-time

Generate proxy classes during build through annotation processing. Zero reflection at runtime, GraalVM native-image-ready, JPMS-compliant.

@StaticLoggingProxy →

What you get out of the box.

Pre & post actions

Hook before and after every invocation without touching the implementation.

Security rules

Block calls declaratively. Rule returns false, the proxy refuses the call.

Dropwizard metrics

Method timings, JMX reporting, console reporting — wired through one builder call.

Virtual proxies

Lazy creation strategies for expensive interface implementations.

Method decorators

Compose before, around and after in a single processor.

Custom processors

Extend BasicStaticProxyAnnotationProcessor for your own annotations.

Need this built for your stack?

Custom annotation processors, proxy architectures and Java-26 migrations — from the author of ProxyBuilder.

Talk to Sven →