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 Details

    • ultimateTargetClass

      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 &mdash; 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

      boolean isProxy(Object object)
      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

      boolean isProxyMember(Member member, Object object)
      Check whether the given member is a proxy member of a proxy object or is a static proxy member.
      Parameters:
      member - the member to check
      object - the object to check
      Returns:
      true if the member is a proxy member
    • isHibernateProxy

      boolean isHibernateProxy(Object object)
      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

      boolean isHibernateProxyMember(Member member)
      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

      Object getHibernateProxyTarget(Object object)
      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

      Member resolveTargetMember(Member proxyMember, Class<?> targetClass)
      Resolve matching member on target class.
      Parameters:
      proxyMember - the proxy member
      targetClass - the target class
      Returns:
      matching member on target object if one exists, otherwise the same member
    • resolveTargetMember

      @Deprecated Member resolveTargetMember(Member proxyMember, Object target)
      Deprecated.
      since 7.1, use resolveTargetMember(Member, Class) instead.
      Parameters:
      proxyMember - the proxy member
      target - the target object
      Returns:
      matching member on target object if one exists, otherwise the same member