private Object createServletImpl()
throws Exception
{
if (_bean != null) {
// XXX: need to ask manager?
CreationalContextImpl<?> env = new OwnerCreationalContext(_bean);
InjectManager cdiManager = InjectManager.create();
// server/5130
Object value = cdiManager.findReference(_bean);
if (value != null)
return value;
else
return _bean.create(env);
}
Class<?> servletClass = getServletClass();
Object servlet;
if (_jspFile != null) {
servlet = createJspServlet(_servletName, _jspFile);
if (servlet == null)
throw new ServletException(L.l("'{0}' is a missing JSP file.",
_jspFile));
}
else if (servletClass != null) {
InjectManager inject = InjectManager.create();
if (_comp == null) {
_comp = inject.createInjectionTarget(servletClass);
}
CreationalContextImpl env = new OwnerCreationalContext(null);
try {
// server/1b40
if (_comp != null) {
servlet = _comp.produce(env);