*/
protected Deployment createDeployment(ResourceLoader resourceLoader, CDI11Bootstrap bootstrap) {
final Iterable<Metadata<Extension>> loadedExtensions = loadExtensions(WeldResourceLoader.getClassLoader(), bootstrap);
final TypeDiscoveryConfiguration typeDiscoveryConfiguration = bootstrap.startExtensions(loadedExtensions);
Deployment deployment=null;
DiscoveryStrategy strategy = DiscoveryStrategyFactory.create(
resourceLoader,
bootstrap,
ImmutableSet.<Class<? extends Annotation>> builder().addAll(typeDiscoveryConfiguration.getKnownBeanDefiningAnnotations())
// Add ThreadScoped manually as Weld SE doesn't support implicit bean archives without beans.xml
.add(ThreadScoped.class).build());
Set<WeldBeanDeploymentArchive> discoveredArchives = strategy.performDiscovery();
String isolation = AccessController.doPrivileged(new GetSystemPropertyAction(ARCHIVE_ISOLATION_SYSTEM_PROPERTY));
if (isolation != null && Boolean.valueOf(isolation).equals(Boolean.FALSE)) {
WeldBeanDeploymentArchive archive = WeldBeanDeploymentArchive.merge(bootstrap, discoveredArchives);
deployment = new WeldDeployment(resourceLoader, bootstrap, Collections.singleton(archive), loadedExtensions);
CommonLogger.LOG.archiveIsolationDisabled();
} else {
deployment= new WeldDeployment(resourceLoader, bootstrap, discoveredArchives, loadedExtensions);
CommonLogger.LOG.archiveIsolationEnabled();
}
if(strategy.getClassFileServices() != null) {
deployment.getServices().add(ClassFileServices.class, strategy.getClassFileServices());
}
return deployment;
}