public class SecuredAnnotationSecurityMetadataSource extends AbstractFallbackMethodSecurityMetadataSource
Secured
annotation.
Can also be used with custom security annotations by injecting an
AnnotationMetadataExtractor
. The annotation type will then be obtained from the
generic parameter type supplied to this interface
logger
Constructor and Description |
---|
SecuredAnnotationSecurityMetadataSource() |
SecuredAnnotationSecurityMetadataSource(AnnotationMetadataExtractor annotationMetadataExtractor) |
Modifier and Type | Method and Description |
---|---|
protected Collection<ConfigAttribute> |
findAttributes(Class<?> clazz)
Obtains the security metadata registered against the specified class.
|
protected Collection<ConfigAttribute> |
findAttributes(Method method,
Class<?> targetClass)
Obtains the security metadata applicable to the specified method invocation.
|
Collection<ConfigAttribute> |
getAllConfigAttributes()
If available, returns all of the
ConfigAttribute s defined by the
implementing class. |
getAttributes
getAttributes, supports
public SecuredAnnotationSecurityMetadataSource()
public SecuredAnnotationSecurityMetadataSource(AnnotationMetadataExtractor annotationMetadataExtractor)
protected Collection<ConfigAttribute> findAttributes(Class<?> clazz)
AbstractFallbackMethodSecurityMetadataSource
Subclasses should only return metadata expressed at a class level. Subclasses
should NOT aggregate metadata for each method registered against a class, as the
abstract superclass will separate invoke AbstractFallbackMethodSecurityMetadataSource.findAttributes(Method, Class)
for
individual methods as appropriate.
findAttributes
in class AbstractFallbackMethodSecurityMetadataSource
clazz
- the target class for the invocation (never null
)protected Collection<ConfigAttribute> findAttributes(Method method, Class<?> targetClass)
AbstractFallbackMethodSecurityMetadataSource
Note that the Method.getDeclaringClass()
may not equal the
targetClass
. Both parameters are provided to assist subclasses which
may wish to provide advanced capabilities related to method metadata being
"registered" against a method even if the target class does not declare the method
(i.e. the subclass may only inherit the method).
findAttributes
in class AbstractFallbackMethodSecurityMetadataSource
method
- the method for the current invocation (never null
)targetClass
- the target class for the invocation (may be null
)public Collection<ConfigAttribute> getAllConfigAttributes()
SecurityMetadataSource
ConfigAttribute
s defined by the
implementing class.
This is used by the AbstractSecurityInterceptor
to perform startup time
validation of each ConfigAttribute
configured against it.
ConfigAttribute
s or null
if unsupported