Package org.jboss.weld
Class AbstractCDI<T>
- java.lang.Object
-
- javax.enterprise.inject.spi.CDI<T>
-
- org.jboss.weld.AbstractCDI<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
Iterable<T>,javax.enterprise.inject.Instance<T>,javax.inject.Provider<T>
- Direct Known Subclasses:
SimpleCDI,WeldContainer
public abstract class AbstractCDI<T> extends javax.enterprise.inject.spi.CDI<T>Abstract implementation of CDI which forwards all Instance methods to a delegate. Furthermore, it allows the calling class to be identified using thegetCallingClassName()method.- Author:
- Jozef Hartinger
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<String>knownClassNames
-
Constructor Summary
Constructors Constructor Description AbstractCDI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy(T instance)Tget()protected StringgetCallingClassName()ExaminesStackTraceElements to figure out which class invoked a method onCDI.protected javax.enterprise.inject.Instance<T>getInstance()Subclasses are allowed to override the default behavior, i.e.booleanisAmbiguous()booleanisUnsatisfied()Iterator<T>iterator()javax.enterprise.inject.Instance<T>select(Annotation... qualifiers)<U extends T>
javax.enterprise.inject.Instance<U>select(Class<U> subtype, Annotation... qualifiers)<U extends T>
javax.enterprise.inject.Instance<U>select(javax.enterprise.util.TypeLiteral<U> subtype, Annotation... qualifiers)-
Methods inherited from class javax.enterprise.inject.spi.CDI
current, getBeanManager, setCDIProvider
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
get
public T get()
-
select
public javax.enterprise.inject.Instance<T> select(Annotation... qualifiers)
-
select
public <U extends T> javax.enterprise.inject.Instance<U> select(Class<U> subtype, Annotation... qualifiers)
-
select
public <U extends T> javax.enterprise.inject.Instance<U> select(javax.enterprise.util.TypeLiteral<U> subtype, Annotation... qualifiers)
-
isUnsatisfied
public boolean isUnsatisfied()
-
isAmbiguous
public boolean isAmbiguous()
-
destroy
public void destroy(T instance)
-
getCallingClassName
protected String getCallingClassName()
ExaminesStackTraceElements to figure out which class invoked a method onCDI.
-
getInstance
protected javax.enterprise.inject.Instance<T> getInstance()
Subclasses are allowed to override the default behavior, i.e. to cache instance per BeanManager.- Returns:
- the
Instancethe relevant calls are delegated to
-
-