Package org.apache.webbeans.container

Examples of org.apache.webbeans.container.InjectionResolver


     */
    private Object getInjectedObjectReference(InjectionPoint injectionPoint, BeanManagerImpl beanManager) {
        Object object = null;

        //Injected contextual beam
        InjectionResolver injectionResolver = beanManager.getInjectionResolver();

        Bean<?> injectedBean = (Bean<?>) injectionResolver.getInjectionPointBean(injectionPoint);

        if (isInstanceProviderInjection(injectionPoint)) {
            InstanceBean.local.set(injectionPoint);
        } else if (isEventProviderInjection(injectionPoint)) {
            EventBean.local.set(injectionPoint);
View Full Code Here


                    if (i != -1) {
                        part = beanName.substring(0, i);
                    }

                    if (beanName.equals(other)) {
                        InjectionResolver resolver = webBeansContext.getBeanManagerImpl().getInjectionResolver();
                        Set<Bean<?>> beans = resolver.implResolveByName(beanName);
                        if (beans.size() > 1) {
                            beans = resolver.findByAlternatives(beans);
                            if (beans.size() > 1) {
                                throw new WebBeansConfigurationException("There are two different beans with name : " + beanName + " in the deployment archieve");
                            }
                        }
                    } else {
View Full Code Here

        }
       
        Annotation[] anns = new Annotation[this.bindingAnnotations.size()];
        anns = this.bindingAnnotations.toArray(anns);
       
        InjectionResolver resolver = InjectionResolver.getInstance();
        Set<Bean<T>> beans = resolver.implResolveByType(this.injectionClazz, this.actualTypeArguments, anns);
       
        ResolutionUtil.checkResolvedBeans(beans, this.injectionClazz);
       
        Bean<T> bean = beans.iterator().next();
       
View Full Code Here

    }
   

    private void validate(Set<Bean<?>> beans)
    {
        InjectionResolver resolver = ManagerImpl.getManager().getInjectionResolver();
       
        if (beans != null && beans.size() > 0)
        {
            for (Bean<?> bean : beans)
            {
                //Bean injection points
                Set<InjectionPoint> injectionPoints = bean.getInjectionPoints();
                               
                for (InjectionPoint injectionPoint : injectionPoints)
                {
                    //Check for correct injection type
                    resolver.checkInjectionPointType(injectionPoint);
                   
                    Class<?> rawType = getRawTypeForInjectionPoint(injectionPoint);
                   
                    //Comment out while testing TCK Events Test --- WBTCK27 jira./////
                    //Hack for EntityManager --> Solve in M3!!!!
                    if(rawType.equals(Event.class) || rawType.getSimpleName().equals("EntityManager"))
                    {
                        continue;
                    }
                    /////////////////////////////////////////////////////////////////
                   
                    // check for InjectionPoint injection
                    if (rawType.equals(InjectionPoint.class))
                    {
                        if (injectionPoint.getAnnotations().length == 1 && injectionPoint.getAnnotations()[0].annotationType().equals(Current.class))
                        {
                            if (!bean.getScopeType().equals(Dependent.class))
                            {
                                throw new WebBeansConfigurationException("Bean " + bean + "scope can not define other scope except @Dependent to inject InjectionPoint");
                            }
                        }
                    }
                    else
                    {
                        resolver.checkInjectionPoints(injectionPoint);
                    }
                }
            }
        }
       
View Full Code Here

                        part = beanName.substring(0,i);               
                    }
                   
                    if(beanName.equals(other))
                    {
                        InjectionResolver resolver = InjectionResolver.getInstance();
                        Set<Bean<?>> beans = resolver.implResolveByName(beanName);
                        if(beans.size() > 1)
                        {
                            beans = resolver.findByAlternatives(beans);                           
                            if(beans.size() > 1)
                            {
                                throw new WebBeansConfigurationException("There are two different beans with name : " + beanName + " in the deployment archieve");  
                            }  
                        }
View Full Code Here

    private Set<Bean<?>> resolveBeans()
    {
        Annotation[] anns = new Annotation[this.qualifierAnnotations.size()];
        anns = this.qualifierAnnotations.toArray(anns);

        InjectionResolver resolver = InjectionResolver.getInstance();
        Set<Bean<?>> beans = resolver.implResolveByType(this.injectionClazz, anns);
       
        return beans;
    }
View Full Code Here

                        part = beanName.substring(0,i);               
                    }
                   
                    if(beanName.equals(other))
                    {
                        InjectionResolver resolver = InjectionResolver.getInstance();
                        Set<Bean<?>> beans = resolver.implResolveByName(beanName);
                        if(beans.size() > 1)
                        {
                            beans = resolver.findByAlternatives(beans);                           
                            if(beans.size() > 1)
                            {
                                throw new WebBeansConfigurationException("There are two different beans with name : " + beanName + " in the deployment archieve");  
                            }  
                        }
View Full Code Here

    private Set<Bean<?>> resolveBeans()
    {
        Annotation[] anns = new Annotation[this.qualifierAnnotations.size()];
        anns = this.qualifierAnnotations.toArray(anns);

        InjectionResolver resolver = InjectionResolver.getInstance();
        Set<Bean<?>> beans = resolver.implResolveByType(this.injectionClazz, anns);
       
        return beans;
    }
View Full Code Here

        //Don't attempt to get an instance of the delegate injection point
        if (injectionPoint.isDelegate())
        {
            return true;
        }
        InjectionResolver instance = webBeansContext.getBeanManagerImpl().getInjectionResolver();

        Bean<?> bean = instance.getInjectionPointBean(injectionPoint);
        if((bean instanceof EnterpriseBeanMarker) ||
                (bean instanceof ResourceBean) ||
                (bean instanceof InstanceBean) ||
                (bean instanceof EventBean) ||
                (bean instanceof InjectionPointBean) ||
View Full Code Here

           
            //Clear extensions
            webBeansContext.getExtensionLoader().clear();
           
            //Delete Resolutions Cache
            InjectionResolver injectionResolver = webBeansContext.getBeanManagerImpl().getInjectionResolver();

            injectionResolver.clearCaches();
           
            //Delte proxies
            webBeansContext.getProxyFactory().clear();
           
            //Delete AnnotateTypeCache
View Full Code Here

TOP

Related Classes of org.apache.webbeans.container.InjectionResolver

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.