package com.github.ruediste.laf.core;

import javax.inject.Inject;

import com.github.ruediste.laf.core.web.assetPipeline.AssetPipelineConfiguration;
import com.github.ruediste.laf.core.web.assetPipeline.AssetRequestMapper;
import com.github.ruediste.laf.util.Initializer;

public class CoreDynamicInitializer implements Initializer {

	@Inject
	CoreConfiguration config;

	@Inject
	AssetPipelineConfiguration pipelineConfig;

	@Inject
	AssetRequestMapper assetRequestMapper;

	@Override
	public void initialize() {
		config.dynamicClassLoader = Thread.currentThread()
				.getContextClassLoader();
		config.initialize();
		pipelineConfig.initialize();
		assetRequestMapper.initialize();
	}

}

@@ -47,25 +47,251 @@
 java
-x.inject.Inject;%0A
+.io.IOException;%0Aimport java.io.PrintWriter;%0A%0Aimport javax.inject.Inject;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0Aimport com.github.ruediste.laf.core.front.ReloadCountHolder;%0Aimport com.github.ruediste.laf.core.httpRequest.HttpRequest;
 %0Aimp
@@ -696,16 +696,118 @@
 apper;%0A%0A
+%09@Inject%0A%09PathInfoIndex index;%0A%0A%09@Inject%0A%09ReloadCountHolder holder;%0A%0A%09@Inject%0A%09CoreRequestInfo info;%0A%0A
 %09@Overri
@@ -1008,15 +1008,731 @@
 alize();
+%0A%0A%09%09index.registerPathInfo(%22/~reloadQuery%22, new RequestParser() %7B%0A%0A%09%09%09@Override%0A%09%09%09public RequestParseResult parse(HttpRequest request) %7B%0A%0A%09%09%09%09return new RequestParseResult() %7B%0A%0A%09%09%09%09%09@Override%0A%09%09%09%09%09public void handle() %7B%0A%09%09%09%09%09%09boolean doReload = holder.waitForReload(Long%0A%09%09%09%09%09%09%09%09.parseLong(request.getParameter(%22nr%22)));%0A%09%09%09%09%09%09HttpServletResponse response = info%0A%09%09%09%09%09%09%09%09.getServletResponse();%0A%0A%09%09%09%09%09%09response.setContentType(%22text/plain;charset=utf-8%22);%0A%09%09%09%09%09%09PrintWriter out;%0A%09%09%09%09%09%09try %7B%0A%09%09%09%09%09%09%09out = response.getWriter();%0A%09%09%09%09%09%09%09out.write(doReload ? %22true%22 : %22false%22);%0A%09%09%09%09%09%09%09out.close();%0A%09%09%09%09%09%09%7D catch (IOException e) %7B%0A%09%09%09%09%09%09%09throw new RuntimeException(%22Error sending response%22);%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D;%0A%09%09%09%7D%0A%09%09%7D);
 %0A%09%7D%0A%0A%7D%0A

add handler for ~reloadQuery