// from there.
//
// Using a lookup of a managed bean allows the user to set configuration properties on the
// manager class and its properties.
FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
AccessScopeManager manager = (AccessScopeManager) fa.getRequestAttribute(REQ_ATTR_KEY);
if (manager != null)
{
// already found and cached in request attributes
return manager;
}
// Backwards compatibility hack: look for FlashScopeManager. It is possible that
// a user of Orchestra 1.0 has copied the declaration from the original Orchestra
// config file into their own code to inject special settings.
manager = (AccessScopeManager) fa.getBean(FlashScopeManager.class.getName());
if (manager != null)
{
fa.setRequestAttribute(REQ_ATTR_KEY, manager);
return manager;
}
// Backwards compatibility hack: look for FlashScopeManagerConfiguration. It is
// possible that a user of Orchestra 1.0 has overridden just the Configuration
// bit to set their own ignoredViewId values (as recommended!):
//
// This is a little dodgy as settings made through the new AccessScopeManage
// bean will will now be silently ignored.
FlashScopeManagerConfiguration cfg = (FlashScopeManagerConfiguration) fa.getBean(FlashScopeManagerConfiguration.class.getName());
if (cfg != null)
{
manager = new AccessScopeManager();
manager.setAccessScopeManagerConfiguration(cfg);
fa.setRequestAttribute(REQ_ATTR_KEY, manager);
return manager;
}
// normal case
manager = (AccessScopeManager) fa.getBean(AccessScopeManager.class.getName());
if (manager != null)
{
fa.setRequestAttribute(REQ_ATTR_KEY, manager);
return manager;
}
// TODO: Make this error message less spring-specific. Spring is not the only IOC container
// that Orchestra can be used with.