Package org.apache.struts2.util
Interface ProxyService
- All Known Implementing Classes:
StrutsProxyService
public interface ProxyService
Service interface for proxy detection and resolution operations.
Replaces static
ProxyUtil methods with an injectable service.- Since:
- 7.2.0
-
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.
-
Method Details
-
ultimateTargetClass
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.- 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
Check whether the given object is a proxy.- Parameters:
object- the object to check- Returns:
- true if the object is a Spring AOP or Hibernate proxy
-
isProxyMember
Check whether the given member is a proxy member of a proxy object or is a static proxy member.- Parameters:
member- the member to checkobject- the object to check- Returns:
- true if the member is a proxy member
-
isHibernateProxy
Check whether the given object is a Hibernate proxy.- Parameters:
object- the object to check- Returns:
- true if the object is a Hibernate proxy
-
isHibernateProxyMember
Check whether the given member is a member of a Hibernate proxy.- Parameters:
member- the member to check- Returns:
- true if the member is a Hibernate proxy member
-
getHibernateProxyTarget
Get the target instance of the given object if it is a Hibernate proxy object, otherwise return the given object.- Parameters:
object- the object to check- Returns:
- the target instance or the original object
-
resolveTargetMember
Resolve matching member on target class.- Parameters:
proxyMember- the proxy membertargetClass- the target class- Returns:
- matching member on target object if one exists, otherwise the same member
-
resolveTargetMember
Deprecated.since 7.1, useresolveTargetMember(Member, Class)instead.- Parameters:
proxyMember- the proxy membertarget- the target object- Returns:
- matching member on target object if one exists, otherwise the same member
-
resolveTargetMember(Member, Class)instead.