Class CdiProxyService

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

public class CdiProxyService extends StrutsProxyService
CDI-aware ProxyService. Extends the default StrutsProxyService (Spring + Hibernate detection) with recognition of Weld client proxies, so SecurityMemberAccess can resolve the real target class of a normal-scoped CDI bean before evaluating the OGNL allowlist.
See Also:
  • Constructor Details

  • Method Details

    • 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
      Overrides:
      isProxy in class StrutsProxyService
      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
      Overrides:
      isProxyMember in class StrutsProxyService
      Parameters:
      member - the member to check
      object - the object to check
      Returns:
      true if the member is a proxy member
    • 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
      Overrides:
      ultimateTargetClass in class StrutsProxyService
      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)