public class AlternativesManager extends Object
BeanManagerImpl.resolve(java.util.Set)
The boot order for 1.) is to first register all the alternatives and stereotypes
from the XML.
After that the AnnotatedType scanning is performed and all @Alternatives with
@Priority get added as well. We will also add classes which have an Alternative stereotype.
After the AnnotatedTypes got scanned we have to fire the AfterTypeDiscovery
event with the collected effective alternative classes sorted by their priority.
Any extension can re-order the alternatives which then form the base of the resolve() handling
at runtime.Constructor and Description |
---|
AlternativesManager(WebBeansContext webBeansContext) |
Modifier and Type | Method and Description |
---|---|
void |
addPrioritizedAlternativeBean(javax.enterprise.inject.spi.Bean<?> prioritizedBean)
This method is used to add Alternative Beans which implement the
Prioritized interface
This is performed after the Bean get's added. |
void |
addPriorityClazzAlternative(Class<?> clazz,
Priority priority)
This method is used to add Alternatives which have a @Priority annotation.
|
void |
addXmlClazzAlternative(Class<?> alternative)
This methods gets called while scanning the various beans.xml files.
|
void |
addXmlStereoTypeAlternative(Class<?> alternative)
This methods gets called while scanning the various beans.xml files.
|
void |
clear() |
List<Class<?>> |
getPrioritizedAlternatives()
Alternatives get ordered by their priority and as lowest priority all
the alternatives added via XML get added.
|
Set<Class<?>> |
getXmlConfiguredAlternatives() |
boolean |
isAlternative(javax.enterprise.inject.spi.Bean<?> bean) |
boolean |
isAlternative(Class<?> beanType,
Set<Class<? extends Annotation>> stereotypes) |
boolean |
isAlternativeStereotype(Class<? extends Annotation> stereo) |
public AlternativesManager(WebBeansContext webBeansContext)
public void addXmlStereoTypeAlternative(Class<?> alternative)
public void addXmlClazzAlternative(Class<?> alternative)
public void addPriorityClazzAlternative(Class<?> clazz, Priority priority)
public void addPrioritizedAlternativeBean(javax.enterprise.inject.spi.Bean<?> prioritizedBean)
Prioritized
interface
This is performed after the Bean get's added.public List<Class<?>> getPrioritizedAlternatives()
public boolean isAlternative(javax.enterprise.inject.spi.Bean<?> bean)
true
if the given bean is a configured alternativepublic boolean isAlternative(Class<?> beanType, Set<Class<? extends Annotation>> stereotypes)
true
if the given bean is a configured alternativepublic Set<Class<?>> getXmlConfiguredAlternatives()
public boolean isAlternativeStereotype(Class<? extends Annotation> stereo)
public void clear()
Copyright © 2008–2020 The Apache Software Foundation. All rights reserved.