org.springframework.config.java.support.cglib
Class BeanMethodMethodInterceptor

java.lang.Object
  extended by org.springframework.config.java.support.cglib.BeanMethodMethodInterceptor
All Implemented Interfaces:
net.sf.cglib.proxy.Callback, net.sf.cglib.proxy.MethodInterceptor

public class BeanMethodMethodInterceptor
extends java.lang.Object
implements net.sf.cglib.proxy.MethodInterceptor

CGLIB MethodInterceptor that applies to methods on the configuration instance. Purpose: subclass configuration to ensure that singleton methods return the same object on subsequent invocations, including self-invocation.

This implementation is thread-safe.

Author:
Rod Johnson, Costin Leau

Constructor Summary
BeanMethodMethodInterceptor(org.springframework.beans.factory.config.ConfigurableListableBeanFactory owningBeanFactory, BeanNameTrackingDefaultListableBeanFactory childFactory, MethodBeanWrapper beanWrapper, BeanNamingStrategy namingStrategy)
           
 
Method Summary
protected  java.lang.String getBeanName(java.lang.reflect.Method m)
           
 java.lang.Object intercept(java.lang.Object o, java.lang.reflect.Method m, java.lang.Object[] args, net.sf.cglib.proxy.MethodProxy mp)
           
protected  boolean isCurrentlyInCreation(java.lang.String beanName)
           
protected  java.lang.Object returnWrappedResultMayBeCached(java.lang.String beanName, java.lang.Object o, java.lang.reflect.Method m, java.lang.Object[] args, net.sf.cglib.proxy.MethodProxy mp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanMethodMethodInterceptor

public BeanMethodMethodInterceptor(org.springframework.beans.factory.config.ConfigurableListableBeanFactory owningBeanFactory,
                                   BeanNameTrackingDefaultListableBeanFactory childFactory,
                                   MethodBeanWrapper beanWrapper,
                                   BeanNamingStrategy namingStrategy)
Method Detail

intercept

public java.lang.Object intercept(java.lang.Object o,
                                  java.lang.reflect.Method m,
                                  java.lang.Object[] args,
                                  net.sf.cglib.proxy.MethodProxy mp)
                           throws java.lang.Throwable
Specified by:
intercept in interface net.sf.cglib.proxy.MethodInterceptor
Throws:
java.lang.Throwable

getBeanName

protected java.lang.String getBeanName(java.lang.reflect.Method m)

returnWrappedResultMayBeCached

protected java.lang.Object returnWrappedResultMayBeCached(java.lang.String beanName,
                                                          java.lang.Object o,
                                                          java.lang.reflect.Method m,
                                                          java.lang.Object[] args,
                                                          net.sf.cglib.proxy.MethodProxy mp)
                                                   throws java.lang.Throwable
Throws:
java.lang.Throwable

isCurrentlyInCreation

protected boolean isCurrentlyInCreation(java.lang.String beanName)


Copyright © 2005-2007 Spring Framework. All Rights Reserved.