org.apache.webbeans.container
Class InjectionResolver

java.lang.Object
  extended by org.apache.webbeans.container.InjectionResolver

public class InjectionResolver
extends Object

Injection point resolver class.

It is a singleton class per BeanManager. It is responsible for resolving the bean instances at the injection points for its bean manager.

Version:
$Rev: 1539593 $ $Date: 2013-11-07 12:05:29 +0100 (Thu, 07 Nov 2013) $
See Also:
WebBeansFinder

Constructor Summary
InjectionResolver(WebBeansContext webBeansContext)
          Creates a new injection resolve for given bean manager.
 
Method Summary
 void checkInjectionPoint(InjectionPoint injectionPoint)
          Check that a valid enabled bean exists in the deployment for the given injection point definition.
 void checkInjectionPointType(InjectionPoint injectionPoint)
          Check the type of the injection point.
 void clearCaches()
          Clear caches.
 Set<Bean<?>> findByAlternatives(Set<Bean<?>> result)
          Gets alternatives from set.
 Set<Bean<?>> findByAlternatives(Set<Bean<?>> result, String bdaBeansXMLFilePath)
          Gets alternatives from set.
 Set<Bean<?>> findBySpecialization(Set<Bean<?>> result)
          Returns specialized beans if exists, otherwise return input result
 Bean<?> getInjectionPointBean(InjectionPoint injectionPoint)
          Returns bean for injection point.
 Set<Bean<?>> implResolveByName(String name)
          Returns set of beans for given bean name.
 Set<Bean<?>> implResolveByType(boolean isDelegate, Type injectionPointType, Annotation... qualifiers)
          Resolution by type.
 Set<Bean<?>> implResolveByType(boolean isDelegate, Type injectionPointType, Class<?> injectionPointClass, Annotation... qualifiers)
          Resolution by type.
<X> Bean<? extends X>
resolve(Set<Bean<? extends X>> beans)
           
<X> Set<Bean<? extends X>>
resolveAll(Set<Bean<? extends X>> beans)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InjectionResolver

public InjectionResolver(WebBeansContext webBeansContext)
Creates a new injection resolve for given bean manager.

Parameters:
webBeansContext - WebBeansContext
Method Detail

clearCaches

public void clearCaches()
Clear caches.


checkInjectionPointType

public void checkInjectionPointType(InjectionPoint injectionPoint)
Check the type of the injection point.

Injection point type can not be TypeVariable.

Parameters:
injectionPoint - injection point
Throws:
WebBeansConfigurationException - if not obey the rule

checkInjectionPoint

public void checkInjectionPoint(InjectionPoint injectionPoint)
Check that a valid enabled bean exists in the deployment for the given injection point definition.

Parameters:
injectionPoint - injection point
Throws:
WebBeansConfigurationException - If bean is not available in the current deployment for given injection

getInjectionPointBean

public Bean<?> getInjectionPointBean(InjectionPoint injectionPoint)
Returns bean for injection point.

Parameters:
injectionPoint - injection point declaration
Returns:
bean for injection point

implResolveByName

public Set<Bean<?>> implResolveByName(String name)
Returns set of beans for given bean name.

Parameters:
name - bean name
Returns:
set of beans for given bean name

implResolveByType

public Set<Bean<?>> implResolveByType(boolean isDelegate,
                                      Type injectionPointType,
                                      Annotation... qualifiers)
Resolution by type.

Parameters:
isDelegate - whether the InjectionPoint is for a Delegate
injectionPointType - injection point api type
qualifiers - qualifiers of the injection point
Returns:
set of resolved beans

implResolveByType

public Set<Bean<?>> implResolveByType(boolean isDelegate,
                                      Type injectionPointType,
                                      Class<?> injectionPointClass,
                                      Annotation... qualifiers)
Resolution by type.

Parameters:
isDelegate - whether the InjectionPoint is for a Delegate
injectionPointType - injection point api type
qualifiers - qualifiers of the injection point
Returns:
set of resolved beans

findBySpecialization

public Set<Bean<?>> findBySpecialization(Set<Bean<?>> result)
Returns specialized beans if exists, otherwise return input result

Parameters:
result - result beans
Returns:
specialized beans if exists, otherwise return input result

findByAlternatives

public Set<Bean<?>> findByAlternatives(Set<Bean<?>> result)
Gets alternatives from set.

Parameters:
result - resolved set
Returns:
containes alternatives

findByAlternatives

public Set<Bean<?>> findByAlternatives(Set<Bean<?>> result,
                                       String bdaBeansXMLFilePath)
Gets alternatives from set.

Parameters:
result - resolved set
Returns:
containes alternatives

resolve

public <X> Bean<? extends X> resolve(Set<Bean<? extends X>> beans)

resolveAll

public <X> Set<Bean<? extends X>> resolveAll(Set<Bean<? extends X>> beans)


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.