Package org.apache.webbeans.annotation

Examples of org.apache.webbeans.annotation.DefaultLiteral


        conversationComp.addApiType(Conversation.class);
        conversationComp.addApiType(ConversationImpl.class);
        conversationComp.addApiType(Object.class);
        conversationComp.setImplScopeType(new RequestedScopeLiteral());
        conversationComp.addQualifier(new DefaultLiteral());
        conversationComp.addQualifier(new AnyLiteral());
        conversationComp.setName("javax.enterprise.context.conversation");

        WebBeansDecoratorConfig.configureDecorators(conversationComp);
View Full Code Here


        catch (NamingException e)
        {
            //fallback for a servlet container
            BeanManagerImpl beanManager = getWebBeansContext().getBeanManagerImpl();

            Iterator<Bean<?>> beansIterator = beanManager.getBeans(resourceType, new DefaultLiteral()).iterator();

            if (!beansIterator.hasNext())
            {
                logger.log(Level.SEVERE, "can't find ejb (via jndi) or cdi bean for type " + resourceType.getName(), e);
                throw new RuntimeException("can't find ejb (via jndi) or cdi bean for type "
View Full Code Here

       
        startContainer(classes);
       
        ContextFactory.initApplicationContext(null);

        Bean<MyExtension> extension = (Bean<MyExtension>) getBeanManager().getBeans(MyExtension.class, new DefaultLiteral()).iterator().next();
       
        MyExtension ext = (MyExtension) getBeanManager().getReference(extension, MyExtension.class, getBeanManager().createCreationalContext(extension));
       
        System.out.println(ext.toString());
       
View Full Code Here

        Assert.assertEquals("Sucess from getProducts",injector.getTestNamed3());
       
        String icb = getInstance(String.class, new NamedLiteral("ProMethodNamed1"));
        Assert.assertEquals(icb, "Sucess from ProMethodNamed1");
       
        InformationConsumerBean cb = getInstance(InformationConsumerBean.class, new DefaultLiteral());
        Assert.assertNotNull(cb);
       
        Assert.assertEquals(cb.getProMethodString(), "Sucess from ProMethodNamed1");
       
        shutDownContainer();
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    public Conversation getConversationBeanReference()
    {
        BeanManager beanManager = BeanManagerImpl.getManager();
        Bean<Conversation> bean = (Bean<Conversation>)beanManager.getBeans(Conversation.class, new DefaultLiteral()).iterator().next();
        Conversation conversation =(Conversation) beanManager.getReference(bean, Conversation.class, beanManager.createCreationalContext(bean));

        return conversation;
    }
View Full Code Here

                boolean observesAnnotation = false;

                if (annot.length == 0)
                {
                    annot = new Annotation[1];
                    annot[0] = new DefaultLiteral();
                }
                else
                {
                    for (Annotation observersAnnot : annot)
                    {
View Full Code Here

                    if(this.injectionOwnerBean instanceof ProducerMethodBean)
                    {
                        if(parameter.getBaseType().equals(InjectionPoint.class))
                        {
                            BeanManager manager = BeanManagerImpl.getManager();
                            Bean<?> injectionPointBean = manager.getBeans(InjectionPoint.class, new DefaultLiteral()).iterator().next();
                            Object reference = manager.getReference(injectionPointBean, InjectionPoint.class, manager.createCreationalContext(injectionPointBean));
                           
                            this.dependentParameters.put(injectionPointBean, reference);
                            list.add(reference);
                           
View Full Code Here

            listAnnot.add(ann);
        }

        if (listAnnot.isEmpty())
        {
            listAnnot.add(new DefaultLiteral());
        }

        while (it.hasNext())
        {
            decorator = (WebBeansDecorator<?>) it.next();
View Full Code Here

        else
        {
            if (qualifiers.length == 0)
            {
                qualifiers = new Annotation[1];
                qualifiers[0] = new DefaultLiteral();
                currentQualifier = true;
            }                       
        }
       
        if (injectionPointType.equals(Object.class) && currentQualifier)
View Full Code Here

       

        // No-binding annotation
        if (component.getQualifiers().size() == 0 )
        {
            component.addQualifier(new DefaultLiteral());
        }
        else if(component.getQualifiers().size() == 1)
        {
            Annotation annot = component.getQualifiers().iterator().next();
            if(annot.annotationType().equals(Named.class))
            {
                component.addQualifier(new DefaultLiteral());
            }
        }
       
        //Add @Any support
        if(!AnnotationUtil.hasAnyQualifier(component))
View Full Code Here

TOP

Related Classes of org.apache.webbeans.annotation.DefaultLiteral

Copyright © 2018 www.massapicom. 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.