Package org.jboss.weld
Class AbstractCDI<T>
- java.lang.Object
-
- jakarta.enterprise.inject.spi.CDI<T>
-
- org.jboss.weld.AbstractCDI<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
jakarta.enterprise.inject.Instance<T>
,jakarta.inject.Provider<T>
,Iterable<T>
,org.jboss.weld.inject.WeldInstance<T>
- Direct Known Subclasses:
SimpleCDI
public abstract class AbstractCDI<T> extends jakarta.enterprise.inject.spi.CDI<T> implements org.jboss.weld.inject.WeldInstance<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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.weld.inject.WeldInstance
org.jboss.weld.inject.WeldInstance.Handler<T extends Object>
-
-
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 protected void
checkState()
Check whether the container is in a "valid" state, no-op by default.void
destroy(T instance)
T
get()
protected String
getCallingClassName()
ExaminesStackTraceElement
s to figure out which class invoked a method onCDI
.org.jboss.weld.inject.WeldInstance.Handler<T>
getHandler()
protected org.jboss.weld.inject.WeldInstance<T>
getInstance()
Subclasses are allowed to override the default behavior, i.e.Comparator<org.jboss.weld.inject.WeldInstance.Handler<?>>
getPriorityComparator()
Iterable<org.jboss.weld.inject.WeldInstance.Handler<T>>
handlers()
boolean
isAmbiguous()
boolean
isResolvable()
boolean
isUnsatisfied()
Iterator<T>
iterator()
<U extends T>
org.jboss.weld.inject.WeldInstance<U>select(jakarta.enterprise.util.TypeLiteral<U> subtype, Annotation... qualifiers)
org.jboss.weld.inject.WeldInstance<T>
select(Annotation... qualifiers)
<U extends T>
org.jboss.weld.inject.WeldInstance<U>select(Class<U> subtype, Annotation... qualifiers)
<X> org.jboss.weld.inject.WeldInstance<X>
select(Type subtype, Annotation... qualifiers)
-
Methods inherited from class jakarta.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
-
select
public org.jboss.weld.inject.WeldInstance<T> select(Annotation... qualifiers)
-
select
public <U extends T> org.jboss.weld.inject.WeldInstance<U> select(Class<U> subtype, Annotation... qualifiers)
-
select
public <U extends T> org.jboss.weld.inject.WeldInstance<U> select(jakarta.enterprise.util.TypeLiteral<U> subtype, Annotation... qualifiers)
-
select
public <X> org.jboss.weld.inject.WeldInstance<X> select(Type subtype, Annotation... qualifiers)
- Specified by:
select
in interfaceorg.jboss.weld.inject.WeldInstance<T>
-
isUnsatisfied
public boolean isUnsatisfied()
- Specified by:
isUnsatisfied
in interfacejakarta.enterprise.inject.Instance<T>
-
isAmbiguous
public boolean isAmbiguous()
- Specified by:
isAmbiguous
in interfacejakarta.enterprise.inject.Instance<T>
-
destroy
public void destroy(T instance)
- Specified by:
destroy
in interfacejakarta.enterprise.inject.Instance<T>
-
getHandler
public org.jboss.weld.inject.WeldInstance.Handler<T> getHandler()
- Specified by:
getHandler
in interfaceorg.jboss.weld.inject.WeldInstance<T>
-
isResolvable
public boolean isResolvable()
- Specified by:
isResolvable
in interfacejakarta.enterprise.inject.Instance<T>
-
handlers
public Iterable<org.jboss.weld.inject.WeldInstance.Handler<T>> handlers()
- Specified by:
handlers
in interfaceorg.jboss.weld.inject.WeldInstance<T>
-
getPriorityComparator
public Comparator<org.jboss.weld.inject.WeldInstance.Handler<?>> getPriorityComparator()
- Specified by:
getPriorityComparator
in interfaceorg.jboss.weld.inject.WeldInstance<T>
-
getCallingClassName
protected String getCallingClassName()
ExaminesStackTraceElement
s to figure out which class invoked a method onCDI
.
-
getInstance
protected org.jboss.weld.inject.WeldInstance<T> getInstance()
Subclasses are allowed to override the default behavior, i.e. to cache an instance per BeanManager.- Returns:
- the
Instance
the relevant calls are delegated to
-
checkState
protected void checkState()
Check whether the container is in a "valid" state, no-op by default.Subclasses are allowed to override the default behavior, i.e. to check whether a container is running.
-
-