|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.acegisecurity.intercept.method.AbstractMethodDefinitionSource
org.acegisecurity.intercept.method.MethodDefinitionMap
public class MethodDefinitionMap
Stores a ConfigAttributeDefinition
for each method signature defined in a bean context.
For
consistency with MethodDefinitionAttributes
as well as support for
MethodDefinitionSourceAdvisor
, this implementation will return a
ConfigAttributeDefinition
containing all configuration attributes defined against:
In general you should therefore define the interface methods of your secure objects, not the
implementations. For example, define com.company.Foo.findAll=ROLE_TEST
but not
com.company.FooImpl.findAll=ROLE_TEST
.
Field Summary | |
---|---|
protected java.util.Map |
methodMap
Map from Method to ApplicationDefinition |
Constructor Summary | |
---|---|
MethodDefinitionMap()
|
Method Summary | |
---|---|
void |
addSecureMethod(java.lang.Class clazz,
java.lang.String mappedName,
ConfigAttributeDefinition attr)
Add configuration attributes for a secure method. |
void |
addSecureMethod(java.lang.reflect.Method method,
ConfigAttributeDefinition attr)
Add configuration attributes for a secure method. |
void |
addSecureMethod(java.lang.String name,
ConfigAttributeDefinition attr)
Add configuration attributes for a secure method. |
java.util.Iterator |
getConfigAttributeDefinitions()
Obtains the configuration attributes explicitly defined against this bean. |
int |
getMethodMapSize()
Obtains the number of configuration attributes explicitly defined against this bean. |
protected ConfigAttributeDefinition |
lookupAttributes(java.lang.reflect.Method method)
Performs the actual lookup of the relevant ConfigAttributeDefinition for the specified
Method which is subject of the method invocation. |
void |
setMappings(java.util.List mappings)
Easier configuration of the instance, using MethodDefinitionSourceMapping . |
Methods inherited from class org.acegisecurity.intercept.method.AbstractMethodDefinitionSource |
---|
getAttributes, supports |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map methodMap
Constructor Detail |
---|
public MethodDefinitionMap()
Method Detail |
---|
public void addSecureMethod(java.lang.reflect.Method method, ConfigAttributeDefinition attr)
*
for matching multiple methods.
method
- the method to be securedattr
- required authorities associated with the methodpublic void addSecureMethod(java.lang.String name, ConfigAttributeDefinition attr)
*
for matching multiple methods.
name
- class and method name, separated by a dotattr
- required authorities associated with the method
java.lang.IllegalArgumentException
- DOCUMENT ME!public void addSecureMethod(java.lang.Class clazz, java.lang.String mappedName, ConfigAttributeDefinition attr)
*
for matching multiple methods.
clazz
- target interface or classmappedName
- mapped method nameattr
- required authorities associated with the method
java.lang.IllegalArgumentException
- DOCUMENT ME!public java.util.Iterator getConfigAttributeDefinitions()
lookupAttributes(Method)
as it does not have
access to a method invocation at this time.
public int getMethodMapSize()
lookupAttributes(Method)
as it
does not have access to a method invocation at this time.
protected ConfigAttributeDefinition lookupAttributes(java.lang.reflect.Method method)
AbstractMethodDefinitionSource
ConfigAttributeDefinition
for the specified
Method
which is subject of the method invocation.Provided so subclasses need only to
provide one basic method to properly interface with the MethodDefinitionSource
.
Returns null
if there are no matching attributes for the method.
lookupAttributes
in class AbstractMethodDefinitionSource
method
- the method being invoked for which configuration attributes should be looked up
ConfigAttributeDefinition
that applies to the specified Method
public void setMappings(java.util.List mappings)
MethodDefinitionSourceMapping
.
mappings
- List
of MethodDefinitionSourceMapping
objects.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |