ObjectFactoryBuilder.INSTANCE.setServiceRegistry(context.getServiceRegistry());
NamingContext.initializeNamingManager();
final NamingStore namingStore = new InMemoryNamingStore(new NamingEventCoordinator());
// Create the Naming Service
final ServiceTarget target = context.getServiceTarget();
target.addService(NamingService.SERVICE_NAME, new NamingService(namingStore))
.addAliases(ContextNames.JAVA_CONTEXT_SERVICE_NAME)