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

org.nutz.boot.starter.tio.mvc.TioMvcStarter Maven / Gradle / Ivy

There is a newer version: 2.5.1.v20220215
Show newest version
package org.nutz.boot.starter.tio.mvc;

import org.nutz.boot.AppContext;
import org.nutz.boot.starter.ServerFace;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.tio.http.server.HttpServerStarter;

/**
 *
 * @Author wendal
 */
@IocBean
public class TioMvcStarter implements ServerFace {

    @Inject
    private AppContext appContext;

    protected HttpServerStarter httpServerStarter;

    public void start() throws Exception {
        httpServerStarter = appContext.getIoc().get(HttpServerStarter.class);
        httpServerStarter.start();
    }

    public void stop() throws Exception {
        if (httpServerStarter != null)
            httpServerStarter.stop();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy