if (deployment == null)
throw new IllegalStateException("Null deployment");
if (deployment.getBeanDeploymentArchives().size() == 0)
throw new IllegalStateException("Zero bean deployment archives in the deployment");
BeanDeploymentArchive archive = deployment.getBeanDeploymentArchives().iterator().next();
if (deployment.getBeanDeploymentArchives().size() > 1)
log.warn("More than one bean deployment archives, using the first " + archive);
BeanManager manager = bootstrapBean.getBootstrap().getManager(archive);