+ ": no view controller name found for view " + viewId);
}
// Look up the definition with the specified name.
ConfigurableApplicationContext appContext = getApplicationContext();
ConfigurableListableBeanFactory beanFactory = appContext.getBeanFactory();
BeanDefinition beanDefinition = beanFactory.getBeanDefinition(viewControllerName);
if (beanDefinition.getBeanClassName().equals(ScopedProxyFactoryBean.class.getName()))
{
// The BeanDefinition we found is one that contains a nested aop:scopedProxy tag.
// In this case, Spring has actually renamed the original BeanDefinition which
// contains the data we need. So here we need to look up the renamed definition.
//
// It would be nice if the fake definition that Spring creates had some way of
// fetching the definition it wraps, but instead it appears that we need to
// rely on the magic string prefix...
beanDefinition = beanFactory.getBeanDefinition("scopedTarget." + viewControllerName);
}
String scopeName = beanDefinition.getScope();
if (scopeName == null)
{
// should never happen
throw new OrchestraException(
"Error while processing bean " + beanName
+ ": view controller " + viewControllerName + " has no scope.");
}
Scope registeredScope = beanFactory.getRegisteredScope(scopeName);
if (registeredScope == null)
{
throw new OrchestraException(
"Error while processing bean " + beanName
+ ": view controller " + viewControllerName