final ImpalaOsgiApplicationContext applicationContext = new ImpalaOsgiApplicationContext(parent) {
@Override
protected void registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory) {
//need to add these here because don't get the chance after startRefresh() has been called
beanFactory.addBeanPostProcessor(new ServiceRegistryPostProcessor(serviceRegistry));
beanFactory.addBeanPostProcessor(new ModuleDefinitionPostProcessor(moduleDefinition));
super.registerBeanPostProcessors(beanFactory);
}
};
return applicationContext;