Package org.springframework.aot.hint
Class ProxyHints
java.lang.Object
org.springframework.aot.hint.ProxyHints
Gather the need for using proxies at runtime.
- Since:
- 6.0
- Author:
- Stephane Nicoll
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the class-based proxies that are required.Return the interface-based proxies that are required.registerClassProxy(Class<?> targetClass, Consumer<ClassProxyHint.Builder> classProxyHint) Register that a class proxy is required for the specified class.registerClassProxy(TypeReference typeReference, Consumer<ClassProxyHint.Builder> classProxyHint) Register that a class proxy is required for the class defined by the specifiedTypeReference.registerJdkProxy(Class<?>... proxiedInterfaces) Register that a JDK proxy implementing the specified interfaces is required.registerJdkProxy(Consumer<JdkProxyHint.Builder> jdkProxyHint) Register aJdkProxyHint.registerJdkProxy(TypeReference... proxiedInterfaces) Register that a JDK proxy implementing the interfaces defined by the specified type references is required.
-
Constructor Details
-
ProxyHints
public ProxyHints()
-
-
Method Details
-
jdkProxies
Return the interface-based proxies that are required.- Returns:
- a stream of
JdkProxyHint
-
classProxies
Return the class-based proxies that are required.- Returns:
- a stream of
ClassProxyHint
-
registerJdkProxy
Register aJdkProxyHint.- Parameters:
jdkProxyHint- the consumer of the hint builder- Returns:
this, to facilitate method chaining
-
registerJdkProxy
Register that a JDK proxy implementing the interfaces defined by the specified type references is required.- Parameters:
proxiedInterfaces- the type references for the interfaces the proxy should implement- Returns:
this, to facilitate method chaining
-
registerJdkProxy
Register that a JDK proxy implementing the specified interfaces is required.When registering a JDK proxy for Spring AOP, consider using
AopProxyUtils.completeJdkProxyInterfaces()for convenience.- Parameters:
proxiedInterfaces- the interfaces the proxy should implement- Returns:
this, to facilitate method chaining
-
registerClassProxy
public ProxyHints registerClassProxy(TypeReference typeReference, Consumer<ClassProxyHint.Builder> classProxyHint) Register that a class proxy is required for the class defined by the specifiedTypeReference.- Parameters:
typeReference- the type reference for the target class of the proxyclassProxyHint- 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 proxyclassProxyHint- a builder to further customize the hint for that proxy- Returns:
this, to facilitate method chaining
-