services.add(SLSBInvocationInjectionPoint.class, new SLSBInvocationInjectionPoint());
services.add(CurrentEventMetadata.class, new CurrentEventMetadata());
services.add(SpecializationAndEnablementRegistry.class, new SpecializationAndEnablementRegistry());
services.add(MissingDependenciesRegistry.class, new MissingDependenciesRegistry());
GlobalObserverNotifierService observerNotificationService = new GlobalObserverNotifierService(services, contextId);
services.add(GlobalObserverNotifierService.class, observerNotificationService);
/*
* Setup ExecutorServices
*/
ExecutorServices executor = services.get(ExecutorServices.class);
if (executor == null) {
executor = ExecutorServicesFactory.create(DefaultResourceLoader.INSTANCE);
if (executor != null) {
services.add(ExecutorServices.class, executor);
}
}
services.add(RequiredAnnotationDiscovery.class, new RequiredAnnotationDiscovery(services.get(ReflectionCache.class)));
/*
* Setup Validator
*/
BootstrapConfiguration bootstrapConfiguration = services.get(BootstrapConfiguration.class);
if (bootstrapConfiguration.isConcurrentDeploymentEnabled() && services.contains(ExecutorServices.class)) {
services.add(Validator.class, new ConcurrentValidator(executor));
} else {
services.add(Validator.class, new Validator());
}
/*
* Preloader for container lifecycle events
*/
ContainerLifecycleEventPreloader preloader = null;
int preloaderThreadPoolSize = bootstrapConfiguration.getPreloaderThreadPoolSize();
if (preloaderThreadPoolSize > 0 && Permissions.hasPermission(Permissions.MODIFY_THREAD_GROUP)) {
preloader = new ContainerLifecycleEventPreloader(preloaderThreadPoolSize, observerNotificationService.getGlobalLenientObserverNotifier());
}
services.add(ContainerLifecycleEvents.class, new ContainerLifecycleEvents(preloader, services.get(RequiredAnnotationDiscovery.class)));
services.add(GlobalEnablementBuilder.class, new GlobalEnablementBuilder());
if (!services.contains(HttpContextActivationFilter.class)) {