Spring Security Framework

org.springframework.security.intercept.method
Class DelegatingMethodDefinitionSource

java.lang.Object
  extended by org.springframework.security.intercept.method.DelegatingMethodDefinitionSource
All Implemented Interfaces:
InitializingBean, MethodDefinitionSource, ObjectDefinitionSource

public final class DelegatingMethodDefinitionSource
extends Object
implements MethodDefinitionSource, InitializingBean

Automatically tries a series of method definition sources, relying on the first source of metadata that provides a non-null response.

Version:
$Id$
Author:
Ben Alex

Constructor Summary
DelegatingMethodDefinitionSource()
           
 
Method Summary
 void afterPropertiesSet()
           
 ConfigAttributeDefinition getAttributes(Method method, Class targetClass)
           
 ConfigAttributeDefinition getAttributes(Object object)
          Accesses the ConfigAttributeDefinition that applies to a given secure object.
 Collection getConfigAttributeDefinitions()
          If available, returns all of the ConfigAttributeDefinitions defined by the implementing class.
 void setMethodDefinitionSources(List methodDefinitionSources)
           
 boolean supports(Class clazz)
          Indicates whether the ObjectDefinitionSource implementation is able to provide ConfigAttributeDefinitions for the indicated secure object type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingMethodDefinitionSource

public DelegatingMethodDefinitionSource()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

getAttributes

public ConfigAttributeDefinition getAttributes(Method method,
                                               Class targetClass)
Specified by:
getAttributes in interface MethodDefinitionSource

getAttributes

public ConfigAttributeDefinition getAttributes(Object object)
                                        throws IllegalArgumentException
Description copied from interface: ObjectDefinitionSource
Accesses the ConfigAttributeDefinition that applies to a given secure object.

Returns null if no ConfigAttribiteDefinition applies.

Specified by:
getAttributes in interface ObjectDefinitionSource
Parameters:
object - the object being secured
Returns:
the ConfigAttributeDefinition that applies to the passed object
Throws:
IllegalArgumentException - if the passed object is not of a type supported by the ObjectDefinitionSource implementation

getConfigAttributeDefinitions

public Collection getConfigAttributeDefinitions()
Description copied from interface: ObjectDefinitionSource
If available, returns all of the ConfigAttributeDefinitions defined by the implementing class.

This is used by the AbstractSecurityInterceptor to perform startup time validation of each ConfigAttribute configured against it.

Specified by:
getConfigAttributeDefinitions in interface ObjectDefinitionSource
Returns:
the ConfigAttributeDefinitions or null if unsupported

supports

public boolean supports(Class clazz)
Description copied from interface: ObjectDefinitionSource
Indicates whether the ObjectDefinitionSource implementation is able to provide ConfigAttributeDefinitions for the indicated secure object type.

Specified by:
supports in interface ObjectDefinitionSource
Parameters:
clazz - the class that is being queried
Returns:
true if the implementation can process the indicated class

setMethodDefinitionSources

public void setMethodDefinitionSources(List methodDefinitionSources)

Spring Security Framework

Copyright © 2004-2010 SpringSource, Inc. All Rights Reserved.