Search in sources :

Example 1 with Setup

use of org.nutz.mvc.Setup in project nutzboot by nutzam.

the class NbMvcLoading method depose.

public void depose(NutConfig config) {
    if (log.isInfoEnabled())
        log.infof("Nutz.Mvc[%s] is deposing ...", config.getAppName());
    Stopwatch sw = Stopwatch.begin();
    // Firstly, upload the user customized desctroy
    try {
        Setup setup = config.getAttributeAs(Setup.class, Setup.class.getName());
        if (null != setup)
            setup.destroy(config);
    } catch (Exception e) {
        throw new LoadingException(e);
    }
    // Done, print info
    sw.stop();
    if (log.isInfoEnabled())
        log.infof("Nutz.Mvc[%s] is down in %sms", config.getAppName(), sw.getDuration());
}
Also used : Stopwatch(org.nutz.lang.Stopwatch) LoadingException(org.nutz.mvc.LoadingException) Setup(org.nutz.mvc.Setup) LoadingException(org.nutz.mvc.LoadingException)

Aggregations

Stopwatch (org.nutz.lang.Stopwatch)1 LoadingException (org.nutz.mvc.LoadingException)1 Setup (org.nutz.mvc.Setup)1