Application application = (Application) targetClass.getConstructor(Context.class).newInstance(container.getContext());
	public HttpServer getServer(HttpServletRequest request)	{		HttpServer result = this.server;		if (result == null)		{			synchronized (ServerServlet.class)			{				// Find the attribute name to use to store the server reference				String serverAttributeName = getInitParameter(NAME_SERVER_ATTRIBUTE,						NAME_SERVER_ATTRIBUTE_DEFAULT);				// Look up the attribute for a target				result = (HttpServer) getServletContext().getAttribute(serverAttributeName);				if (result == null)				{					// Try to instantiate a new target application					// First, find the application class name					String applicationClassName = getInitParameter(NAME_APPLICATION_CLASS,							null);					if (applicationClassName != null)					{						try						{							// Load the application class using the given class name							Class targetClass = Class.forName(applicationClassName);							Application application = null;							// Create a new instance of the application class							// and store it for reuse by other ServerServlets.							application = (Application) targetClass.newInstance();							// First, let's locate the closest container							Container container = new Container();							result = new HttpServer(container.getContext());							getServletContext().setAttribute(NAME_SERVER_ATTRIBUTE, result);							if (container != null)							{								// Add the HTTP server connector adapting the Servlet requests 								container.getServers().add(result);								// Attach the application								String uriPattern = request.getContextPath()										+ request.getServletPath();								container.getDefaultHost().attach(uriPattern, application);								// Starts the target Restlet								result.start();							}							else							{								log("[Noelios Restlet Engine] - The Restlet container couldn't be instantiated.");							}						}						catch (ClassNotFoundException e)						{							log(									"[Noelios Restlet Engine] - The ServerServlet couldn't find the target class. Please check that your classpath includes "											+ applicationClassName, e);						}						catch (InstantiationException 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 (Exception e)						{							log(									"[Noelios Restlet Engine] - The ServerServlet couldn't start the target Restlet.",									e);						}					}					else					{						log("[Noelios Restlet Engine] - The ServerServlet couldn't find the target class name. Please set the initialization parameter called "								+ NAME_APPLICATION_CLASS);					}				}				this.server = result;			}		}		return result;	}