* There is currently no way of testing whether this will happen, ie null will never
* be returned from this method.
*/
public static Object getRealBean(Object proxy) throws Exception
{
Advised advised = (Advised) proxy;
TargetSource targetSource = advised.getTargetSource();
Object real = targetSource.getTarget();
// Possibly we could add a method on the ScopedBeanTargetSource class to test
// whether the target bean exists. Then here we could cast TargetSource to
// ScopedBeanTargetSource and return null if the target does not exist. This