@Override public void destroy() { if ((getComponent() != null) && (getComponent().isStarted())) { try { getComponent().stop(); } catch (Exception e) { log("Error during the stopping of the Restlet Component", e); } } super.destroy(); }
parentContext)); } catch (NoSuchMethodException e) { log("[Noelios Restlet Engine] - The ServerServlet couldn't invoke the constructor of the target class. Please check this class has a constructor without parameter. The constructor with a parameter of type Context will be used instead."); log( "[Noelios Restlet Engine] - The ServerServlet couldn't find the target class. Please check that your classpath includes " + applicationClassName, e); log( "[Noelios Restlet Engine] - The ServerServlet couldn't instantiate the target class. Please check this class has an empty constructor " + applicationClassName, e); } catch (IllegalAccessException e) { log( "[Noelios Restlet Engine] - The ServerServlet couldn't instantiate the target class. Please check that you have to proper access rights to " + applicationClassName, e); } catch (NoSuchMethodException e) { log( "[Noelios Restlet Engine] - The ServerServlet couldn't invoke the constructor of the target class. Please check this class has a constructor with a single parameter of Context " + applicationClassName, e); } catch (InvocationTargetException e) { log( "[Noelios Restlet Engine] - The ServerServlet couldn't instantiate the target class. An exception was thrown while creating " + applicationClassName, e);
/** * Services a HTTP Servlet request as an uniform call. * * @param request * The HTTP Servlet request. * @param response * The HTTP Servlet response. */ @Override public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final HttpServerHelper helper = getServer(request); if (helper != null) { helper.handle(createCall(helper.getHelped(), request, response)); } else { log("[Noelios Restlet Engine] - Unable to get the Restlet HTTP server connector. Status code 500 returned."); response.sendError(500); } } }
@Override public void init() throws ServletException { if ((getComponent() != null)) { if ((getApplication() != null) && (getApplication().isStopped())) { try { getApplication().start(); } catch (Exception e) { log("Error during the starting of the Restlet Application", e); } } } }
log( "[Noelios Restlet Engine] - The ServerServlet couldn't find the target class. Please check that your classpath includes " + componentClassName, e); } catch (InstantiationException e) { log( "[Noelios Restlet Engine] - The ServerServlet couldn't instantiate the target class. Please check this class has an empty constructor " + componentClassName, e); } catch (IllegalAccessException e) { log( "[Noelios Restlet Engine] - The ServerServlet couldn't instantiate the target class. Please check that you have to proper access rights to " + componentClassName, e);
log("[Noelios Restlet Engine] - Attaching application: " + this.application + " to URI: " + uriPattern); component.getDefaultHost().attach(uriPattern, + defaultRoute.getTemplate() .getPattern()); log("[Noelios Restlet Engine] - Attaching restlet: " + defaultRoute.getNext() + " to URI: " log("[Noelios Restlet Engine] - Attaching restlet: " + route.getNext() + " to URI: " + defaultRoute.getTemplate() .getPattern()); log("[Noelios Restlet Engine] - Attaching restlet: " + defaultRoute.getNext() + " to URI: " log("[Noelios Restlet Engine] - Attaching restlet: " + route.getNext() + " to URI: "