throw new UnsupportedOperationException("Descriptors not supported by Weld");
}
public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException
{
final ShrinkwrapBeanDeploymentArchive beanArchive = archive.as(ShrinkwrapBeanDeploymentArchive.class);
final org.jboss.weld.bootstrap.spi.Deployment deployment = new org.jboss.weld.bootstrap.spi.Deployment()
{
public Collection<BeanDeploymentArchive> getBeanDeploymentArchives()
{
return Arrays.asList((BeanDeploymentArchive)beanArchive);
}
public ServiceRegistry getServices()
{
return beanArchive.getServices();
}
public BeanDeploymentArchive loadBeanDeploymentArchive(
Class<?> beanClass)
{
return beanArchive;
}
/* (non-Javadoc)
* @see org.jboss.weld.bootstrap.spi.Deployment#getExtensions()
*/
public Iterable<Metadata<Extension>> getExtensions()
{
return ServiceLoader.load(Extension.class, beanArchive.getClassLoader());
}
};
ContextClassLoaderManager classLoaderManager = new ContextClassLoaderManager(beanArchive.getClassLoader());
classLoaderManager.enable();
classLoaderManagerInst.set(classLoaderManager);
WeldBootstrap bootstrap = new WeldBootstrap();
beanArchive.setBootstrap(bootstrap);
bootstrap.startContainer(Environments.SE, deployment)
.startInitialization()
.deployBeans()
.validateBeans()