Examples of WeldBootstrap


Examples of org.jboss.weld.bootstrap.WeldBootstrap

        BundleDescriptor topLevelBundleDesc = (BundleDescriptor) bundle.getModuleDescriptor().getDescriptor();

        // First get BeanDeploymentArchive for this ejb
        BeanDeploymentArchive bda = weldDeployer.getBeanDeploymentArchiveForBundle(topLevelBundleDesc);

        WeldBootstrap bootstrap = weldDeployer.getBootstrapForApp(bundle.getApplication());

        BeanManager beanManager = bootstrap.getManager(bda);

        AnnotatedType annotatedType = beanManager.createAnnotatedType(managedClass);
        if (!invokePostConstruct) {
            annotatedType = new NoPostConstructPreDestroyAnnotatedType(annotatedType);
        }
View Full Code Here

Examples of org.jboss.weld.bootstrap.WeldBootstrap

                ejb.getEjbBundleDescriptor().getModuleDescriptor().getDescriptor();

        // First get BeanDeploymentArchive for this ejb
        BeanDeploymentArchive bda = getBDAForBeanClass(topLevelBundleDesc, ejb.getEjbClassName());

        WeldBootstrap bootstrap = weldDeployer.getBootstrapForApp(ejb.getEjbBundleDescriptor().getApplication());
        WeldManager weldManager = bootstrap.getManager(bda);

        org.jboss.weld.ejb.spi.EjbDescriptor ejbDesc = weldManager.getEjbDescriptor(ejb.getName());

        // Get an the Bean object
        Bean<?> bean = weldManager.getBean(ejbDesc);
View Full Code Here

Examples of org.jboss.weld.bootstrap.WeldBootstrap

        BundleDescriptor topLevelBundleDesc = (BundleDescriptor) bundle.getModuleDescriptor().getDescriptor();

        // First get BeanDeploymentArchive for this ejb
        BeanDeploymentArchive bda = weldDeployer.getBeanDeploymentArchiveForBundle(topLevelBundleDesc);
        //BeanDeploymentArchive bda = getBDAForBeanClass(topLevelBundleDesc, managedObject.getClass().getName());
        WeldBootstrap bootstrap = weldDeployer.getBootstrapForApp(bundle.getApplication());
        BeanManager beanManager = bootstrap.getManager(bda);
        AnnotatedType annotatedType = beanManager.createAnnotatedType(managedObject.getClass());
        InjectionTarget it = beanManager.createInjectionTarget(annotatedType);
        CreationalContext cc = beanManager.createCreationalContext(null);
        it.inject(managedObject, cc);
    }
View Full Code Here

Examples of org.jboss.weld.bootstrap.WeldBootstrap

        // First get BeanDeploymentArchive for this ejb
        BeanDeploymentArchive bda = weldDeployer.getBeanDeploymentArchiveForBundle(topLevelBundleDesc);
        //BeanDeploymentArchive bda = getBDAForBeanClass(topLevelBundleDesc, managedClass.getName());

        WeldBootstrap bootstrap = weldDeployer.getBootstrapForApp(bundle.getApplication());

        BeanManager beanManager = bootstrap.getManager(bda);

        AnnotatedType annotatedType = beanManager.createAnnotatedType(managedClass);
        if (!invokePostConstruct) {
            annotatedType = new NoPostConstructPreDestroyAnnotatedType(annotatedType);
        }
View Full Code Here

Examples of org.jboss.weld.bootstrap.WeldBootstrap

                }

                if( bundle != null ) {
                    BeanDeploymentArchive bda = weldDeployer.getBeanDeploymentArchiveForBundle(bundle);
                    if( bda != null ) {
                        WeldBootstrap bootstrap = weldDeployer.getBootstrapForApp(bundle.getApplication());

                        beanManager = bootstrap.getManager(bda);
                    }
                }

            }
        }
View Full Code Here

Examples of org.jboss.weld.bootstrap.WeldBootstrap

    }

    public BeansXml getBeansXml() {
        BeansXml result = null;

        WeldBootstrap wb = context.getTransientAppMetaData(WeldDeployer.WELD_BOOTSTRAP,
                                                           WeldBootstrap.class);
        if (beansXmlURLs.size() == 1) {
            result = wb.parse(beansXmlURLs.get(0));
        } else {
            // This method attempts to performs a merge, but loses some
            // information (e.g., version, bean-discovery-mode)
            result = wb.parse(beansXmlURLs);
        }

        return result;
    }
View Full Code Here

Examples of org.jboss.weld.bootstrap.WeldBootstrap

        return cdiAnnotatedClassNames.contains(className);
    }


    protected BeansXml parseBeansXML(ReadableArchive archive, String beansXMLPath) throws IOException {
        WeldBootstrap wb = context.getTransientAppMetaData(WeldDeployer.WELD_BOOTSTRAP,
                                                           WeldBootstrap.class);
        return wb.parse(getBeansXMLFileURL(archive, beansXMLPath));
    }
View Full Code Here

Examples of org.jboss.weld.bootstrap.WeldBootstrap

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);
View Full Code Here

Examples of org.jboss.weld.bootstrap.WeldBootstrap

public class DiscoverFailsBootstrapTest {

    @Test(expectedExceptions = IllegalArgumentException.class)
    public void testDiscoverFails() {
        Bootstrap bootstrap = new WeldBootstrap();
        bootstrap.startContainer(Environments.SE, null);
    }
View Full Code Here

Examples of org.jboss.weld.bootstrap.WeldBootstrap

*/
public class BeansXmlMergingTest {

    @Test
    public void testDuplicatesAreRemoved() {
        WeldBootstrap weldBootstrap = new WeldBootstrap();

        URL url1 = getClass().getResource("/org/jboss/weld/tests/unit/bootstrap/xml/beans1.xml");
        URL url2 = getClass().getResource("/org/jboss/weld/tests/unit/bootstrap/xml/beans2.xml");

        BeansXml beansXml = weldBootstrap.parse(Arrays.asList(url1, url1, url2), true);

        assertEquals(1, beansXml.getEnabledAlternativeStereotypes().size());
        assertEquals("org.jboss.weld.tests.unit.bootstrap.xml.Stereo", beansXml.getEnabledAlternativeStereotypes().get(0).getValue());

        assertEquals(1, beansXml.getEnabledAlternativeClasses().size());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.