Class ProxyHints

java.lang.Object
org.springframework.aot.hint.ProxyHints

public class ProxyHints extends Object
Gather the need of using proxies at runtime.
Since:
6.0
Author:
Stephane Nicoll
  • Constructor Details

    • ProxyHints

      public ProxyHints()
  • Method Details

    • jdkProxies

      public Stream<JdkProxyHint> jdkProxies()
      Return the interfaces-based proxies that are required.
      Returns:
      a stream of JdkProxyHint
    • classProxies

      public Stream<ClassProxyHint> classProxies()
      Return the class-based proxies that are required.
      Returns:
      a stream of ClassProxyHint
    • registerJdkProxy

      public ProxyHints registerJdkProxy(Supplier<JdkProxyHint> hint)
      Register a JdkProxyHint.
      Parameters:
      hint - the supplier to the hint
      Returns:
      this, to facilitate method chaining
    • registerJdkProxy

      public ProxyHints registerJdkProxy(TypeReference... proxiedInterfaces)
      Register that a JDK proxy implementing the interfaces defined by the specified type references is required.
      Parameters:
      proxiedInterfaces - the interfaces the proxy should implement
      Returns:
      this, to facilitate method chaining
    • registerJdkProxy

      public ProxyHints registerJdkProxy(Class<?>... proxiedInterfaces)
      Register that a JDK proxy implementing the specified interfaces is required.
      Parameters:
      proxiedInterfaces - the interfaces the proxy should implement
      Returns:
      this, to facilitate method chaining
    • registerClassProxy

      public ProxyHints registerClassProxy(TypeReference targetClass, Consumer<ClassProxyHint.Builder> classProxyHint)
      Register that a class proxy is required for the class defined by the specified TypeReference.
      Parameters:
      targetClass - the target class of the proxy
      classProxyHint - a builder to further customize the hint for that proxy
      Returns:
      this, to facilitate method chaining
    • registerClassProxy

      public ProxyHints registerClassProxy(Class<?> targetClass, Consumer<ClassProxyHint.Builder> classProxyHint)
      Register that a class proxy is required for the specified class.
      Parameters:
      targetClass - the target class of the proxy
      classProxyHint - a builder to further customize the hint for that proxy
      Returns:
      this, to facilitate method chaining