Package org.perf4j

Examples of org.perf4j.StopWatch


   * @see UserWebService#getUser()
   */
  //SpringSecurity 控制的方法
  @Secured( { "ROLE_Admin" })
  public GetUserResult getUser(String id) {
    StopWatch totalStopWatch = new Slf4JStopWatch();
    //校验请求参数
    try {
      Assert.notNull(id, "id参数为空");
    } catch (IllegalArgumentException e) {
      logger.error(e.getMessage());
      return WSResult.buildResult(GetUserResult.class, WSResult.PARAMETER_ERROR, e.getMessage());
    }

    //获取用户
    try {

      StopWatch dbStopWatch = new Slf4JStopWatch("GetUser.fetchDB");
      User entity = accountManager.getInitedUser(id);
      dbStopWatch.stop();

      UserDTO dto = dozer.map(entity, UserDTO.class);

      GetUserResult result = new GetUserResult();
      result.setUser(dto);
View Full Code Here

TOP

Related Classes of org.perf4j.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.