Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.acegisecurity.intercept.method
Class MethodDefinitionMap

    java.lang.Object
      org.acegisecurity.intercept.method.AbstractMethodDefinitionSource
          org.acegisecurity.intercept.method.MethodDefinitionMap

All Implemented Interfaces:
  MethodDefinitionSource, ObjectDefinitionSource

    public class MethodDefinitionMap

extends AbstractMethodDefinitionSource

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:

- The method-specific attributes defined for the intercepted method of the intercepted class.
- The method-specific attributes defined by any explicitly implemented interface if that interface contains a method signature matching that of the intercepted method.

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`.

Version:
  $Id: MethodDefinitionMap.java,v 1.6 2005/11/17 00:56:09 benalex Exp $
Author:
  Ben Alex

Field Summary
`protected Map` | `methodMap` Map from Method to ApplicationDefinition

Constructor Summary
`MethodDefinitionMap()`

Method Summary
`void` | `addSecureMethod(Class clazz, String mappedName, ConfigAttributeDefinition attr)` Add configuration attributes for a secure method.
`void` | `addSecureMethod(Method method, ConfigAttributeDefinition attr)` Add configuration attributes for a secure method.
`void` | `addSecureMethod(String name, ConfigAttributeDefinition attr)` Add configuration attributes for a secure method.
`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(Method method)` Performs the actual lookup of the relevant `ConfigAttributeDefinition` for the specified `Method` which is subject of the method invocation.

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

### methodMap

    protected Map methodMap

  Map from Method to ApplicationDefinition

Constructor Detail

### MethodDefinitionMap

    public MethodDefinitionMap()

Method Detail

### getConfigAttributeDefinitions

    public Iterator getConfigAttributeDefinitions()

  Obtains the configuration attributes explicitly defined against this bean. This method will not return implicit configuration attributes that may be returned by `lookupAttributes(Method)` as it does not have access to a method invocation at this time.

  Returns:
    the attributes explicitly defined against this bean

### getMethodMapSize

    public int getMethodMapSize()

  Obtains the number of configuration attributes explicitly defined against this bean. This method will not return implicit configuration attributes that may be returned by `lookupAttributes(Method)` as it does not have access to a method invocation at this time.

  Returns:
    the number of configuration attributes explicitly defined against this bean

### addSecureMethod

    public void addSecureMethod(Method method,
                                ConfigAttributeDefinition attr)

  Add configuration attributes for a secure method. Method names can end or start with `*` for matching multiple methods.

  Parameters:
    `method` - the method to be secured
    `attr` - required authorities associated with the method

### addSecureMethod

    public void addSecureMethod(String name,
                                ConfigAttributeDefinition attr)

  Add configuration attributes for a secure method. Method names can end or start with `*` for matching multiple methods.

  Parameters:
    `name` - class and method name, separated by a dot
    `attr` - required authorities associated with the method
  Throws:
    `IllegalArgumentException` - DOCUMENT ME!

### addSecureMethod

    public void addSecureMethod(Class clazz,
                                String mappedName,
                                ConfigAttributeDefinition attr)

  Add configuration attributes for a secure method. Method names can end or start with `*` for matching multiple methods.

  Parameters:
    `clazz` - target interface or class
    `mappedName` - mapped method name
    `attr` - required authorities associated with the method
  Throws:
    `IllegalArgumentException` - DOCUMENT ME!

### lookupAttributes

    protected ConfigAttributeDefinition lookupAttributes(Method method)

  Description copied from class: `AbstractMethodDefinitionSource`
  Performs the actual lookup of the relevant `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.

  Specified by:
    `lookupAttributes` in class `AbstractMethodDefinitionSource`
  Parameters:
    `method` - the method being invoked for which configuration attributes should be looked up
  Returns:
    the `ConfigAttributeDefinition` that applies to the specified `Method`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2005 Acegi Technology Pty Limited. All Rights Reserved.