com.github.yoojia.halo.BootstrapServlet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of halo-core Show documentation
Show all versions of halo-core Show documentation
A FAST && THIN && HIGH SCALABLE Java web framework
package com.github.yoojia.halo;
import com.github.yoojia.halo.supports.Bootstrap;
import com.github.yoojia.halo.supports.Context;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.*;
import java.io.IOException;
/**
* @author YOOJIA.CHEN ([email protected])
*/
public final class BootstrapServlet implements Servlet{
private Bootstrap mBootstrap = new Bootstrap();
private final Logger mLogger = LoggerFactory.getLogger(BootstrapServlet.class);
@Override
public void init(ServletConfig config) throws ServletException {
mLogger.trace("Starting HALO-Engine by SERVLET...");
mBootstrap.startup(config.getServletContext());
}
@Override
public ServletConfig getServletConfig() {
return null;
}
@Override
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
mBootstrap.process(req, res);
}
@Override
public String getServletInfo() {
return Context.VERSION;
}
@Override
public void destroy() {
mBootstrap.shutdown();
}
}