public interface Provider<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 |
---|---|
T |
get()
Returns an instance of the selected bean
|
T get()