*/
public static Resource initResource(Resource aResource, ApplicationContext aApplicationContext) {
AutowireCapableBeanFactory beanFactory = aApplicationContext.getAutowireCapableBeanFactory();
if (aResource instanceof PrimitiveAnalysisEngine_impl) {
PropertyAccessor pa = PropertyAccessorFactory.forDirectFieldAccess(aResource);
// Access the actual AnalysisComponent and initialize it
AnalysisComponent analysisComponent = (AnalysisComponent) pa
.getPropertyValue("mAnalysisComponent");
initializeBean(beanFactory, analysisComponent, aResource.getMetaData().getName());
pa.setPropertyValue("mAnalysisComponent", analysisComponent);
return aResource;
} else {
return (Resource) beanFactory.initializeBean(aResource, aResource.getMetaData().getName());
}