All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.yoojia.halo.BootstrapServlet Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy