org.springframework.config.java.aspects
Class RequiredMethodInvocationRegistry
java.lang.Object
java.lang.ThreadLocal<Set<String>>
org.springframework.config.java.aspects.RequiredMethodInvocationRegistry
public class RequiredMethodInvocationRegistry
- extends ThreadLocal<Set<String>>
Thread-local storage for recording which beans' required methods have been
invoked. Used in conjunction with RequiredMethodInvocationTracker
.
Currently limited to recording methods annotated with
@Required
(as opposed to Spring's ability to track
user-specified annotations. This has to do with limitations in AspectJ - it
is currently not possible to change the definition of a pointcut at runtime.
- Author:
- Chris Beams
RequiredMethodInvocationRegistry
public RequiredMethodInvocationRegistry()
initialValue
protected Set<String> initialValue()
- Overrides:
initialValue
in class ThreadLocal<Set<String>>
registerMethodInvocation
public void registerMethodInvocation(Object bean,
String className,
String methodName)
- Record the invocation of a
@Required
method for later
interrogation.
- Parameters:
bean
- object instance being on which methodName is
being invokedclassName
- declaring class for methodNamemethodName
- Required method currently being invoked- See Also:
interrogateRequiredMethods(Object, String)
interrogateRequiredMethods
public void interrogateRequiredMethods(Object bean,
String beanName)
- Interrogate any
@Required
methods within bean
and determine whether they have been invoked.
- Parameters:
bean
- object to interrogatebeanName
- id/name of bean within its respective
BeanFactory
clear
public void clear()
- Remove all method invocation records from the registry.
toString
public String toString()
- Overrides:
toString
in class Object
Copyright ? 2005-2008 Spring Framework. All Rights Reserved.