Search in sources :

Example 21 with StopWatch

use of cn.taketoday.util.StopWatch in project today-framework by TAKETODAY.

the class AbstractHttpServer method stop.

@Override
public final void stop() {
    synchronized (this.lifecycleMonitor) {
        if (isRunning()) {
            String serverName = getClass().getSimpleName();
            logger.debug("Stopping " + serverName + "...");
            this.running = false;
            try {
                StopWatch stopWatch = new StopWatch();
                stopWatch.start();
                stopInternal();
                logger.debug("Server stopped (" + stopWatch.getTotalTimeMillis() + " millis).");
            } catch (Throwable ex) {
                throw new IllegalStateException(ex);
            } finally {
                reset();
            }
        }
    }
}
Also used : StopWatch(cn.taketoday.util.StopWatch)

Example 22 with StopWatch

use of cn.taketoday.util.StopWatch in project today-framework by TAKETODAY.

the class AbstractHttpServer method start.

// Lifecycle
@Override
public final void start() {
    synchronized (this.lifecycleMonitor) {
        if (!isRunning()) {
            String serverName = getClass().getSimpleName();
            if (logger.isDebugEnabled()) {
                logger.debug("Starting " + serverName + "...");
            }
            this.running = true;
            try {
                StopWatch stopWatch = new StopWatch();
                stopWatch.start();
                startInternal();
                long millis = stopWatch.getTotalTimeMillis();
                if (logger.isDebugEnabled()) {
                    logger.debug("Server started on port " + getPort() + "(" + millis + " millis).");
                }
            } catch (Throwable ex) {
                throw new IllegalStateException(ex);
            }
        }
    }
}
Also used : StopWatch(cn.taketoday.util.StopWatch)

Aggregations

StopWatch (cn.taketoday.util.StopWatch)22 ITestBean (cn.taketoday.beans.testfixture.beans.ITestBean)12 ClassPathXmlApplicationContext (cn.taketoday.context.support.ClassPathXmlApplicationContext)8 Advised (cn.taketoday.aop.framework.Advised)6 TestBean (cn.taketoday.beans.testfixture.beans.TestBean)4 Test (org.junit.jupiter.api.Test)4 StandardBeanFactory (cn.taketoday.beans.factory.support.StandardBeanFactory)2 DerivedTestBean (cn.taketoday.beans.testfixture.beans.DerivedTestBean)2 IndexedTestBean (cn.taketoday.beans.testfixture.beans.IndexedTestBean)2 ResourceTestBean (cn.taketoday.tests.sample.beans.ResourceTestBean)2