public final class ProtectPointcutPostProcessor
extends java.lang.Object
implements org.springframework.beans.factory.config.BeanPostProcessor
MapBasedMethodDefinitionSource
.
This class provides a convenient way of declaring a list of pointcuts, and then
having every method of every bean defined in the Spring application context compared with
those pointcuts. Where a match is found, the matching method will be registered with the
MapBasedMethodDefinitionSource
.
It is very important to understand that only the first pointcut that matches a given method will be taken as authoritative for that method. This is why pointcuts should be provided as a LinkedHashMap, because their order is very important.
Note also that only beans defined in the Spring application context will be examined by this class.
Because this class registers method security metadata with MapBasedMethodDefinitionSource
,
normal Spring Security capabilities such as MethodDefinitionSourceAdvisor
can be used.
It does not matter the fact the method metadata was originally obtained from an AspectJ pointcut
expression evaluation.
Constructor and Description |
---|
ProtectPointcutPostProcessor(MapBasedMethodDefinitionSource mapBasedMethodDefinitionSource) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
postProcessAfterInitialization(java.lang.Object bean,
java.lang.String beanName) |
java.lang.Object |
postProcessBeforeInitialization(java.lang.Object bean,
java.lang.String beanName) |
void |
setPointcutMap(java.util.Map map) |
public ProtectPointcutPostProcessor(MapBasedMethodDefinitionSource mapBasedMethodDefinitionSource)
public java.lang.Object postProcessAfterInitialization(java.lang.Object bean, java.lang.String beanName) throws org.springframework.beans.BeansException
postProcessAfterInitialization
in interface org.springframework.beans.factory.config.BeanPostProcessor
org.springframework.beans.BeansException
public java.lang.Object postProcessBeforeInitialization(java.lang.Object bean, java.lang.String beanName) throws org.springframework.beans.BeansException
postProcessBeforeInitialization
in interface org.springframework.beans.factory.config.BeanPostProcessor
org.springframework.beans.BeansException
public void setPointcutMap(java.util.Map map)