Assert.notNull(serviceRegistryFactory, "serviceRegistryFactory cannot be null");
ClassLoaderRegistry classLoaderRegistry = classLoaderRegistryFactory.newClassLoaderRegistry();
ModuleStateHolder moduleStateHolder = moduleStateHolderFactory.newModuleStateHolder();
ServiceRegistry serviceRegistry = serviceRegistryFactory.newServiceRegistry();
Application application = new ImpalaApplication(classLoaderRegistry, moduleStateHolder, serviceRegistry, id);
return application;
}