Package org.springframework.util

Examples of org.springframework.util.StopWatch


      return true;
    }
  }

  void reloadRootModule() {
    StopWatch watch = new StopWatch();
    watch.start();
    Impala.reloadRootModule();
    watch.stop();
    String rootName = Impala.getRootModuleDefinition().getName();
    InteractiveCommandUtils.printReloadInfo(rootName, rootName, watch);
  }
View Full Code Here


    String rootName = Impala.getRootModuleDefinition().getName();
    InteractiveCommandUtils.printReloadInfo(rootName, rootName, watch);
  }
 
  void reloadModule(String moduleToReload, CommandState commandState) {
    StopWatch watch = new StopWatch();
    watch.start();
    String actualModule = null;

    if (!Impala.reload(moduleToReload)) {
      actualModule = Impala.reloadLike(moduleToReload);
    } else {
      actualModule = moduleToReload;
    }
    watch.stop();

    if (moduleToReload != null)
      commandState.addProperty(ACTUAL_MODULE_RELOADED, new CommandPropertyValue(moduleToReload));
    InteractiveCommandUtils.printReloadInfo(moduleToReload, actualModule, watch);
  }
View Full Code Here

            return true;
        }
    }

    void reloadRootModule() {
        StopWatch watch = new StopWatch();
        watch.start();
        Impala.reloadRootModule();
        watch.stop();
        String rootName = Impala.getRootModuleDefinition().getName();
        InteractiveCommandUtils.printReloadInfo(rootName, rootName, watch);
    }
View Full Code Here

        String rootName = Impala.getRootModuleDefinition().getName();
        InteractiveCommandUtils.printReloadInfo(rootName, rootName, watch);
    }
   
    void reloadModule(String moduleToReload, CommandState commandState) {
        StopWatch watch = new StopWatch();
        watch.start();
        String actualModule = null;

        if (!Impala.reloadModule(moduleToReload)) {
            actualModule = Impala.reloadModuleLike(moduleToReload);
        } else {
            actualModule = moduleToReload;
        }
        watch.stop();

        if (moduleToReload != null)
            commandState.addProperty(ACTUAL_MODULE_RELOADED, new CommandPropertyValue(moduleToReload));
        InteractiveCommandUtils.printReloadInfo(moduleToReload, actualModule, watch);
    }
View Full Code Here

      return true;
    }
  }

  void reloadRootModule() {
    StopWatch watch = new StopWatch();
    watch.start();
    Impala.reloadRootModule();
    watch.stop();
    String rootName = Impala.getRootModuleDefinition().getName();
    InteractiveCommandUtils.printReloadInfo(rootName, rootName, watch);
  }
View Full Code Here

    String rootName = Impala.getRootModuleDefinition().getName();
    InteractiveCommandUtils.printReloadInfo(rootName, rootName, watch);
  }
 
  void reloadModule(String moduleToReload, CommandState commandState) {
    StopWatch watch = new StopWatch();
    watch.start();
    String actualModule = null;

    if (!Impala.reload(moduleToReload)) {
      actualModule = Impala.reloadLike(moduleToReload);
    } else {
      actualModule = moduleToReload;
    }
    watch.stop();

    if (moduleToReload != null)
      commandState.addProperty(ACTUAL_MODULE_RELOADED, new CommandPropertyValue(moduleToReload));
    InteractiveCommandUtils.printReloadInfo(moduleToReload, actualModule, watch);
  }
View Full Code Here

   * @see #setExceptionMessage
   */
  @Override
  protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable {
    String name = invocation.getMethod().getDeclaringClass().getName() + "." + invocation.getMethod().getName();
    StopWatch stopWatch = new StopWatch(name);
    Object returnValue = null;
    boolean exitThroughException = false;
    try {
      stopWatch.start(name);
      writeToLog(logger,
          replacePlaceholders(this.enterMessage, invocation, null, null, -1));
      returnValue = invocation.proceed();
      return returnValue;
    }
    catch (Throwable ex) {
      if(stopWatch.isRunning()) {
        stopWatch.stop();
      }
      exitThroughException = true;
      writeToLog(logger,
          replacePlaceholders(this.exceptionMessage, invocation, null, ex, stopWatch.getTotalTimeMillis()), ex);
      throw ex;
    }
    finally {
      if (!exitThroughException) {
        if(stopWatch.isRunning()) {
          stopWatch.stop();
        }
        writeToLog(logger,
            replacePlaceholders(this.exitMessage, invocation, returnValue, null, stopWatch.getTotalTimeMillis()));
      }
    }
  }
View Full Code Here

      return true;
    }
  }

  void reloadRootModule() {
    StopWatch watch = new StopWatch();
    watch.start();
    Impala.reloadRootModule();
    watch.stop();
    String rootName = Impala.getRootModuleDefinition().getName();
    InteractiveCommandUtils.printReloadInfo(rootName, rootName, watch);
  }
View Full Code Here

    String rootName = Impala.getRootModuleDefinition().getName();
    InteractiveCommandUtils.printReloadInfo(rootName, rootName, watch);
  }
 
  void reloadModule(String moduleToReload, CommandState commandState) {
    StopWatch watch = new StopWatch();
    watch.start();
    String actualModule = null;

    if (!Impala.reload(moduleToReload)) {
      actualModule = Impala.reloadLike(moduleToReload);
    } else {
      actualModule = moduleToReload;
    }
    watch.stop();

    if (moduleToReload != null)
      commandState.addProperty(ACTUAL_MODULE_RELOADED, new CommandPropertyValue(moduleToReload));
    InteractiveCommandUtils.printReloadInfo(moduleToReload, actualModule, watch);
  }
View Full Code Here


  @Override
  protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable {
    String name = createInvocationTraceName(invocation);
    StopWatch stopWatch = new StopWatch(name);
    stopWatch.start(name);
    try {
      return invocation.proceed();
    }
    finally {
      stopWatch.stop();
      logger.trace(stopWatch.shortSummary());
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.util.StopWatch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.