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 ClassLoader per JVM. It is responsible for resolving the bean instances at the injection points for its bean manager.

Version:
$Rev: 1002487 $ $Date: 2010-09-29 08:22:02 +0200 (Mi, 29 Sep 2010) $
See Also:
WebBeansFinder

Constructor Summary
InjectionResolver(BeanManagerImpl manager)
          Creates a new injection resolve for given bean manager.
 
Method Summary
 void checkInjectionPoints(InjectionPoint injectionPoint)
          Check that bean exist in the deployment for 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<?>> findBySpecialization(Set<Bean<?>> result)
          Returns specialized beans if exists, otherwise return input result
 Bean<?> getInjectionPointBean(InjectionPoint injectionPoint)
          Returns bean for injection point.
static InjectionResolver getInstance()
          Returns bean manager injection resolver.
 Set<Bean<?>> implResolveByName(String name)
          Returns set of beans for given bean name.
 Set<Bean<?>> implResolveByType(Type injectionPointType, Annotation... qualifiers)
          Resolution by type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InjectionResolver

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

Parameters:
manager - bean manager
Method Detail

clearCaches

public void clearCaches()
Clear caches.


getInstance

public static InjectionResolver getInstance()
Returns bean manager injection resolver.

Returns:
bean manager injection resolver
See Also:
WebBeansFinder

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

checkInjectionPoints

public void checkInjectionPoints(InjectionPoint injectionPoint)
Check that bean exist in the deployment for given injection point definition.

Parameters:
injectionPoint - injection point
Throws:
WebBeansConfigurationException - If bean is not avialable 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(Type injectionPointType,
                                      Annotation... qualifiers)
Resolution by type.

Parameters:
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


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.