public interface Instance<T> extends Provider<T>, java.lang.Iterable<T>
package example;
import javax.enterprise.inject.*;
import javax.servlet.*;
public class MyServlet extends GenericServlet {
@Obtains
@Instance<MyBean> _beanFactory;
public void service(ServletRequest req, ServletResponse res)
{
MyBean bean = _beanFactory.get();
}
}
javax.event.Event
Modifier and Type | Method and Description |
---|---|
boolean |
isAmbiguous()
Test if there are multiple beans that match the instance.
|
boolean |
isUnsatisfied()
Test if there are any beans that match the instance.
|
Instance<T> |
select(java.lang.annotation.Annotation... qualifiers)
Restricts the instance given a set of qualifiers
|
<U extends T> |
select(java.lang.Class<U> subtype,
java.lang.annotation.Annotation... qualifiers)
Restricts the instance to a subtype and bindings.
|
<U extends T> |
select(TypeLiteral<U> subtype,
java.lang.annotation.Annotation... qualifiers)
Restricts the instance to a subtype and bindings.
|
Instance<T> select(java.lang.annotation.Annotation... qualifiers)
<U extends T> Instance<U> select(java.lang.Class<U> subtype, java.lang.annotation.Annotation... qualifiers)
<U extends T> Instance<U> select(TypeLiteral<U> subtype, java.lang.annotation.Annotation... qualifiers)
boolean isUnsatisfied()
boolean isAmbiguous()