{
_context = context;
for (final String beanName : BeanFactoryUtils.beanNamesIncludingAncestors(_context))
{
ServiceDef serviceDef = new ServiceDef()
{
private Object getBean()
{
return _context.getBean(beanName);
}
private Class getBeanType()
{
return _context.getType(beanName);
}
public ObjectCreator createServiceCreator(ServiceBuilderResources resources)
{
return new ObjectCreator()
{
public Object createObject()
{
return getBean();
}
};
}
public String getServiceId()
{
return beanName;
}
public Class getServiceInterface()
{
return getBeanType();
}
public String getServiceScope()
{
return IOCConstants.DEFAULT_SCOPE;
}
public boolean isEagerLoad()
{
return false;
}
/** Returns an empty set, Spring has no concept of a marker annotation. */
public Set<Class> getMarkers()
{
return Collections.emptySet();
}
};
_serviceDefs.put(beanName, serviceDef);
}
// And add one service that is the Spring WebApplicationContext.
ServiceDef serviceDef = new ServiceDef()
{
public ObjectCreator createServiceCreator(ServiceBuilderResources resources)
{
return new ObjectCreator()