public abstract class AutoProxyUtils extends Object
AbstractAutoProxyCreator
Modifier and Type | Field and Description |
---|---|
static String |
ORIGINAL_TARGET_CLASS_ATTRIBUTE
Bean definition attribute that indicates the original target class of an
auto-proxied bean, e.g.
|
static String |
PRESERVE_TARGET_CLASS_ATTRIBUTE
Bean definition attribute that may indicate whether a given bean is supposed
to be proxied with its target class (in case of it getting proxied in the first
place).
|
Constructor and Description |
---|
AutoProxyUtils() |
Modifier and Type | Method and Description |
---|---|
static Class<?> |
determineTargetClass(ConfigurableListableBeanFactory beanFactory,
String beanName)
Determine the original target class for the specified bean, if possible,
otherwise falling back to a regular
getType lookup. |
static boolean |
shouldProxyTargetClass(ConfigurableListableBeanFactory beanFactory,
String beanName)
Determine whether the given bean should be proxied with its target
class rather than its interfaces.
|
public static final String PRESERVE_TARGET_CLASS_ATTRIBUTE
Boolean.TRUE
or Boolean.FALSE
.
Proxy factories can set this attribute if they built a target class proxy for a specific bean, and want to enforce that bean can always be cast to its target class (even if AOP advices get applied through auto-proxying).
public static final String ORIGINAL_TARGET_CLASS_ATTRIBUTE
public static boolean shouldProxyTargetClass(ConfigurableListableBeanFactory beanFactory, @Nullable String beanName)
"preserveTargetClass" attribute
of the corresponding bean definition.beanFactory
- the containing ConfigurableListableBeanFactorybeanName
- the name of the bean@Nullable public static Class<?> determineTargetClass(ConfigurableListableBeanFactory beanFactory, @Nullable String beanName)
getType
lookup.beanFactory
- the containing ConfigurableListableBeanFactorybeanName
- the name of the beanBeanFactory.getType(String)