org.codehaus.xfire.spring.SpringUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xfire-spring Show documentation
Show all versions of xfire-spring Show documentation
Spring configuration support for XFire.
package org.codehaus.xfire.spring;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;
public class SpringUtils
{
/**
* Gets the actual bean underlying the AOP proxies.
*
* @param bean
* @return
* @throws Exception
*/
public static Object getUserTarget(Object bean)
throws Exception
{
if (AopUtils.isAopProxy(bean) && bean instanceof Advised)
{
Advised advised = (Advised) bean;
bean = advised.getTargetSource().getTarget();
return getUserTarget(bean);
}
return bean;
}
}