Class StrutsProxyService

java.lang.Object
org.apache.struts2.util.StrutsProxyService
All Implemented Interfaces:
ProxyService

public class StrutsProxyService extends Object implements ProxyService
Default implementation of ProxyService. Provides proxy detection and resolution for Spring AOP and Hibernate proxies.
Since:
7.2.0
  • Constructor Details

    • StrutsProxyService

      public StrutsProxyService(ProxyCacheFactory<?,?> proxyCacheFactory)
  • Method Details

    • ultimateTargetClass

      public Class<?> ultimateTargetClass(Object candidate)
      Description copied from interface: ProxyService
      Determine the ultimate target class of the given instance, traversing not only a top-level proxy but any number of nested proxies as well &mdash; as long as possible without side effects.
      Specified by:
      ultimateTargetClass in interface ProxyService
      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

      public boolean isProxy(Object object)
      Description copied from interface: ProxyService
      Check whether the given object is a proxy.
      Specified by:
      isProxy in interface ProxyService
      Parameters:
      object - the object to check
      Returns:
      true if the object is a Spring AOP or Hibernate proxy
    • isProxyMember

      public boolean isProxyMember(Member member, Object object)
      Description copied from interface: ProxyService
      Check whether the given member is a proxy member of a proxy object or is a static proxy member.
      Specified by:
      isProxyMember in interface ProxyService
      Parameters:
      member - the member to check
      object - the object to check
      Returns:
      true if the member is a proxy member
    • isHibernateProxy

      public boolean isHibernateProxy(Object object)
      Description copied from interface: ProxyService
      Check whether the given object is a Hibernate proxy.
      Specified by:
      isHibernateProxy in interface ProxyService
      Parameters:
      object - the object to check
      Returns:
      true if the object is a Hibernate proxy
    • isHibernateProxyMember

      public boolean isHibernateProxyMember(Member member)
      Description copied from interface: ProxyService
      Check whether the given member is a member of a Hibernate proxy.
      Specified by:
      isHibernateProxyMember in interface ProxyService
      Parameters:
      member - the member to check
      Returns:
      true if the member is a Hibernate proxy member
    • getHibernateProxyTarget

      public Object getHibernateProxyTarget(Object object)
      Description copied from interface: ProxyService
      Get the target instance of the given object if it is a Hibernate proxy object, otherwise return the given object.
      Specified by:
      getHibernateProxyTarget in interface ProxyService
      Parameters:
      object - the object to check
      Returns:
      the target instance or the original object
    • resolveTargetMember

      public Member resolveTargetMember(Member proxyMember, Class<?> targetClass)
      Description copied from interface: ProxyService
      Resolve matching member on target class.
      Specified by:
      resolveTargetMember in interface ProxyService
      Parameters:
      proxyMember - the proxy member
      targetClass - the target class
      Returns:
      matching member on target object if one exists, otherwise the same member
    • resolveTargetMember

      @Deprecated public Member resolveTargetMember(Member proxyMember, Object target)
      Deprecated.
      Specified by:
      resolveTargetMember in interface ProxyService
      Parameters:
      proxyMember - the proxy member
      target - the target object
      Returns:
      matching member on target object if one exists, otherwise the same member