org.springframework.config.java.aspect
Class RequiredMethodInvocationRegistry

java.lang.Object
  extended by java.lang.ThreadLocal<java.util.Set<java.lang.String>>
      extended by org.springframework.config.java.aspect.RequiredMethodInvocationRegistry

public class RequiredMethodInvocationRegistry
extends java.lang.ThreadLocal<java.util.Set<java.lang.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

Constructor Summary
RequiredMethodInvocationRegistry()
           
 
Method Summary
 void clear()
          Remove all method invocation records from the registry.
protected  java.util.Set<java.lang.String> initialValue()
           
 void interrogateRequiredMethods(java.lang.Object bean, java.lang.String beanName)
          Interrogate any @Required methods within bean and determine whether they have been invoked.
 void registerMethodInvocation(java.lang.Object bean, java.lang.String className, java.lang.String methodName)
          Record the invocation of a @Required method for later interrogation.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.ThreadLocal
get, remove, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RequiredMethodInvocationRegistry

public RequiredMethodInvocationRegistry()
Method Detail

initialValue

protected java.util.Set<java.lang.String> initialValue()
Overrides:
initialValue in class java.lang.ThreadLocal<java.util.Set<java.lang.String>>

registerMethodInvocation

public void registerMethodInvocation(java.lang.Object bean,
                                     java.lang.String className,
                                     java.lang.String methodName)
Record the invocation of a @Required method for later interrogation.

Parameters:
bean - object instance being on which methodName is being invoked
className - declaring class for methodName
methodName - Required method currently being invoked
See Also:
interrogateRequiredMethods(Object, String)

interrogateRequiredMethods

public void interrogateRequiredMethods(java.lang.Object bean,
                                       java.lang.String beanName)
Interrogate any @Required methods within bean and determine whether they have been invoked.

Parameters:
bean - object to interrogate
beanName - id/name of bean within its respective BeanFactory

clear

public void clear()
Remove all method invocation records from the registry.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object