Package org.apache.struts2.util
Class StrutsProxyService
java.lang.Object
org.apache.struts2.util.StrutsProxyService
- All Implemented Interfaces:
ProxyService
Default implementation of
ProxyService.
Provides proxy detection and resolution for Spring AOP and Hibernate proxies.- Since:
- 7.2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHibernateProxyTarget(Object object) Get the target instance of the given object if it is a Hibernate proxy object, otherwise return the given object.booleanisHibernateProxy(Object object) Check whether the given object is a Hibernate proxy.booleanisHibernateProxyMember(Member member) Check whether the given member is a member of a Hibernate proxy.booleanCheck whether the given object is a proxy.booleanisProxyMember(Member member, Object object) Check whether the given member is a proxy member of a proxy object or is a static proxy member.resolveTargetMember(Member proxyMember, Class<?> targetClass) Resolve matching member on target class.resolveTargetMember(Member proxyMember, Object target) Deprecated.Class<?>ultimateTargetClass(Object candidate) Determine the ultimate target class of the given instance, traversing not only a top-level proxy but any number of nested proxies as well — as long as possible without side effects.
-
Constructor Details
-
StrutsProxyService
-
-
Method Details
-
ultimateTargetClass
Description copied from interface:ProxyServiceDetermine the ultimate target class of the given instance, traversing not only a top-level proxy but any number of nested proxies as well — as long as possible without side effects.- Specified by:
ultimateTargetClassin interfaceProxyService- Parameters:
candidate- the instance to check (might be a proxy)- Returns:
- the ultimate target class (or the plain class of the given
object as fallback; never
null)
-
isProxy
Description copied from interface:ProxyServiceCheck whether the given object is a proxy.- Specified by:
isProxyin interfaceProxyService- Parameters:
object- the object to check- Returns:
- true if the object is a Spring AOP or Hibernate proxy
-
isProxyMember
Description copied from interface:ProxyServiceCheck whether the given member is a proxy member of a proxy object or is a static proxy member.- Specified by:
isProxyMemberin interfaceProxyService- Parameters:
member- the member to checkobject- the object to check- Returns:
- true if the member is a proxy member
-
isHibernateProxy
Description copied from interface:ProxyServiceCheck whether the given object is a Hibernate proxy.- Specified by:
isHibernateProxyin interfaceProxyService- Parameters:
object- the object to check- Returns:
- true if the object is a Hibernate proxy
-
isHibernateProxyMember
Description copied from interface:ProxyServiceCheck whether the given member is a member of a Hibernate proxy.- Specified by:
isHibernateProxyMemberin interfaceProxyService- Parameters:
member- the member to check- Returns:
- true if the member is a Hibernate proxy member
-
getHibernateProxyTarget
Description copied from interface:ProxyServiceGet the target instance of the given object if it is a Hibernate proxy object, otherwise return the given object.- Specified by:
getHibernateProxyTargetin interfaceProxyService- Parameters:
object- the object to check- Returns:
- the target instance or the original object
-
resolveTargetMember
Description copied from interface:ProxyServiceResolve matching member on target class.- Specified by:
resolveTargetMemberin interfaceProxyService- Parameters:
proxyMember- the proxy membertargetClass- the target class- Returns:
- matching member on target object if one exists, otherwise the same member
-
resolveTargetMember
Deprecated.- Specified by:
resolveTargetMemberin interfaceProxyService- Parameters:
proxyMember- the proxy membertarget- the target object- Returns:
- matching member on target object if one exists, otherwise the same member
-