Package org.apache.struts2.cdi
Class CdiProxyService
java.lang.Object
org.apache.struts2.util.StrutsProxyService
org.apache.struts2.cdi.CdiProxyService
- All Implemented Interfaces:
ProxyService
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck 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.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.Methods inherited from class org.apache.struts2.util.StrutsProxyService
getHibernateProxyTarget, isHibernateProxy, isHibernateProxyMember, resolveTargetMember, resolveTargetMember
-
Constructor Details
-
CdiProxyService
-
-
Method Details
-
isProxy
Description copied from interface:ProxyServiceCheck whether the given object is a proxy.- Specified by:
isProxyin interfaceProxyService- Overrides:
isProxyin classStrutsProxyService- 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- Overrides:
isProxyMemberin classStrutsProxyService- Parameters:
member- the member to checkobject- the object to check- Returns:
- true if the member is a proxy member
-
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- Overrides:
ultimateTargetClassin classStrutsProxyService- 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)
-