Class MethodScan
ReflectionUtil.getAllMethods(Class) hierarchy scan, together with the
bean class it was scanned for.
AopProxyResolver.resolve(Class) used to hand a bare Class<?> to each of its
consumers, and every one of them repeated the same reflective hierarchy walk: the unavailable-
annotation locator, the intercepted-method collector, the diagnostic pass, and
AopEligibility.findAopAnnotatedMethods(Class) - four scans of the same hierarchy on the
startup path, for every bean of every module. This carries the scan's own result so consumers
stop repeating it (D-37).
The bean class travels with the methods rather than being re-derived by each consumer, because
two of AopEligibility's five rules are relative to it - a method is not intrinsically
unproxyable, it is unproxyable from a particular subclass. Passing the two separately
is how they would drift apart later.
Stated limitation, not papered over: this is a value object, not a capability. Nothing stops a
future edit from calling ReflectionUtil.getAllMethods(Class) directly again instead of
building or reusing a scan - the only guard is AopProxyResolverScanCountTest, which
fails if a rescan returns. See issue #309.
- Since:
- 6.3.0
- Author:
- wisdomme
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) Class<?> (package private) static MethodScanConvenience factory for a caller that has not already scanned the class.
-
Field Details
-
beanClass
-
methods
-
-
Constructor Details
-
MethodScan
- Parameters:
beanClass- the class the methods were scanned formethods- the scan result, fromReflectionUtil.getAllMethods(Class)
-
-
Method Details
-
of
Convenience factory for a caller that has not already scanned the class.Exists so single-class entry points that predate
MethodScan-AopEligibility.findAopAnnotatedMethods(Class)among them - keep working without forcing every caller to scan for itself first.AopProxyResolver.resolve(Class)does not use this factory: it builds its one scan directly and hands the same instance to every consumer, which is the single-pass guarantee this class exists for.- Parameters:
beanClass- the class to scan- Returns:
- a scan of the given class's method hierarchy
-
getBeanClass
Class<?> getBeanClass()- Returns:
- the class this scan was taken for
-
getMethods
- Returns:
- the scanned methods, subclass overrides first, bridge and synthetic declarations already dropped
-