I just checked trunk SpringContainer and it has the following getBeanNames method, which doesn't filter to just dwr beans. In other words, it should return the ScopedBean instance along with all other beans in the spring context:
/* (non-Javadoc)
- @see org.directwebremoting.impl.DefaultContainer#getBeanNames()
*/
@Override
public Collection<String> getBeanNames()
{
List<String> names = new ArrayList<String>();
// Snarf the beans from Spring
if (beanFactory instanceof ListableBeanFactory)
{
try
{
ListableBeanFactory listable = (ListableBeanFactory) beanFactory;
names.addAll(Arrays.asList(listable.getBeanDefinitionNames()));
}
catch (IllegalStateException ex)
{
log.warn("List of beanNames does not include Spring beans since the BeanFactory was closed when we tried to read it.");
}
}
else
{
log.warn("List of beanNames does not include Spring beans since your BeanFactory is not a ListableBeanFactory.");
}
// And append the DWR ones
names.addAll(super.getBeanNames());
return Collections.unmodifiableCollection(names);
}
Jim, I am not a Spring expert but from my understanding shouldn't you be using an aop:scoped-proxy to alleviate this issue?
http://static.springsource.org/spring/docs/2.0.x/reference/beans.html (3.4.4.5. Scoped beans as dependencies).
We also briefly mention this in our Spring docs:
http://directwebremoting.org/dwr/documentation/server/integration/spring.html (Scoped Beans).