Annotation Interface ProxyOf


@Target(TYPE) @Retention(RUNTIME) @Documented public @interface ProxyOf
Marks a generated proxy class and names the target class it proxies.

Attached by ProxyFactory.createProxyClass(java.lang.Class<T>, java.util.Set<java.lang.reflect.Method>) at generation time, and read back by ProxyFactory.isProxyClass(Class) and ProxyFactory.unwrap(Class). This is the single source of truth for proxy identity in this codebase: a proxy declares what it proxies instead of a consumer inferring it from the generated class's name - a third-party library's default naming convention, which has already changed underneath this codebase once, when the proxy engine moved from CGLIB to ByteBuddy.

RUNTIME retention is required: the generated proxy is injected into the target's own class loader (see ProxyFactory's class javadoc), and consumers in other packages - manager.TaskManager, aop.ExceptionInterceptor, context.FinalContractValidator - read this annotation reflectively off a bare Class object, long after compile time.

This annotation is framework-internal bookkeeping attached by ProxyFactory itself; a module author never writes it directly.

Since:
6.3.0
Author:
wisdomme
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The class this generated proxy subclasses and delegates to.
  • Element Details

    • value

      Class<?> value
      The class this generated proxy subclasses and delegates to.
      Returns:
      the proxied target class