public class WebComponentInjectionManager<T> implements WebComponentDecorator<T> {
@SuppressWarnings("unchecked")
public void decorate(T webComponent, WebModule wm) {
if (wm.getWebBundleDescriptor().hasExtensionProperty(WeldDeployer.WELD_EXTENSION)) {
DeploymentContext deploymentContext = wm.getWebModuleConfig().getDeploymentContext();
WeldBootstrap weldBootstrap = deploymentContext.getTransientAppMetaData(
WeldDeployer.WELD_BOOTSTRAP, org.jboss.weld.bootstrap.WeldBootstrap.class);
DeploymentImpl deploymentImpl = deploymentContext.getTransientAppMetaData(
WeldDeployer.WELD_DEPLOYMENT, DeploymentImpl.class);
Collection<BeanDeploymentArchive> deployments = deploymentImpl.getBeanDeploymentArchives();
BeanDeploymentArchive beanDeploymentArchive = deployments.iterator().next();
BeanManager beanManager = weldBootstrap.getManager(beanDeploymentArchive);
// PENDING : Not available in this Web Beans Release
CreationalContext<T> ccontext = beanManager.createCreationalContext(null);
@SuppressWarnings("rawtypes")
Class<T> clazz = (Class<T>) webComponent.getClass();
AnnotatedType<T> annotatedType = beanManager.createAnnotatedType(clazz);