Getting Started

What ProxyBuilder is, when to reach for it, and how to add it to a Java project.

ProxyBuilder is a small Java library with two responsibilities:

  1. A runtime proxy builder that wraps an interface implementation with pre-actions, post-actions, security rules, metrics and virtual-proxy strategies — using JDK dynamic proxies under the hood.
  2. Annotation processors that generate static proxy classes at compile time — @StaticLoggingProxy, @StaticMetricsProxy, @StaticVirtualProxy, @StaticObjectAdapter, @DynamicObjectAdapterBuilder.

Both styles share the same supporting infrastructure (metrics through Dropwizard, security rules, virtual proxy strategies).

When to use which strategy

Reach for the runtime builder when you need to wrap an interface that you do not control, or when the proxy configuration depends on runtime state (feature flags, current user, environment).

Reach for compile-time generation when you want the lowest possible runtime cost, when you need GraalVM native-image support without reflection configuration, or when the proxy responsibilities are stable enough to be expressed in annotations.

Requirements

  • JDK 26
  • Maven 4 (the project ships a Maven Wrapper)
  • Licence: EUPL-1.2

What is not in scope

  • ProxyBuilder is not an AOP framework. There is no pointcut language, no classpath scanning, no runtime weaving. You wire proxies explicitly.
  • The annotation processors do not modify existing classes. They generate new classes alongside your interface.
  • Gradle incremental-annotation-processing metadata is not published yet.

Next steps

In this section

  • Quickstart

    Add ProxyBuilder, wrap a service at runtime, see logging output.

  • Installation

    Maven coordinates for runtime use and for annotation processing.

Edit this page on GitHub ↗