log.info("Activating Naming Subsystem");
NamingContext.initializeNamingManager();
// Create the Naming Service
final BatchBuilder builder = updateContext.getBatchBuilder();
builder.addService(NamingService.SERVICE_NAME, new NamingService(true));
// Create java: context service
final JavaContextService javaContextService = new JavaContextService();
builder.addService(JavaContextService.SERVICE_NAME, javaContextService)
.addDependency(NamingService.SERVICE_NAME);
final ContextService globalContextService = new ContextService("global");
builder.addService(JavaContextService.SERVICE_NAME.append("global"), globalContextService)
.addDependency(JavaContextService.SERVICE_NAME, Context.class, globalContextService.getParentContextInjector());
addContextFactory(builder, "app");
addContextFactory(builder, "module");
addContextFactory(builder, "comp");
final JndiView jndiView = new JndiView();
builder.addService(ServiceName.JBOSS.append("naming", "jndi", "view"), jndiView)
.addOptionalDependency(ServiceName.JBOSS.append("mbean", "server"), MBeanServer.class, jndiView.getMBeanServerInjector());
}