Example usage for org.springframework.util StopWatch start

List of usage examples for org.springframework.util StopWatch start

Introduction

In this page you can find the example usage for org.springframework.util StopWatch start.

Prototype

public void start() throws IllegalStateException 

Source Link

Document

Start an unnamed task.

Usage

From source file:net.biocloud.bioservice.config.apidoc.SwaggerConfiguration.java

/**
 * Swagger Springfox configuration.//from   w w w.j a v a 2 s .c om
 */
@Bean
public Docket swaggerSpringfoxDocket(BioserviceProperties bioserviceProperties) {
    log.debug("Starting Swagger");
    StopWatch watch = new StopWatch();
    watch.start();
    ApiInfo apiInfo = new ApiInfo(bioserviceProperties.getSwagger().getTitle(),
            bioserviceProperties.getSwagger().getDescription(), bioserviceProperties.getSwagger().getVersion(),
            bioserviceProperties.getSwagger().getTermsOfServiceUrl(),
            bioserviceProperties.getSwagger().getContact(), bioserviceProperties.getSwagger().getLicense(),
            bioserviceProperties.getSwagger().getLicenseUrl());

    Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo)
            .genericModelSubstitutes(ResponseEntity.class).forCodeGeneration(true)
            .genericModelSubstitutes(ResponseEntity.class).ignoredParameterTypes(Pageable.class)
            .directModelSubstitute(java.time.LocalDate.class, String.class)
            .directModelSubstitute(java.time.ZonedDateTime.class, Date.class)
            .directModelSubstitute(java.time.LocalDateTime.class, Date.class).select()
            .paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());
    return docket;
}

From source file:com.vedri.mtp.frontend.support.apidoc.SwaggerConfiguration.java

/**
 * Swagger Springfox configuration.// w ww .  j  a v a  2  s  . co  m
 */
@Bean
public Docket swaggerSpringfoxDocket(FrontendProperties frontendProperties) {
    log.debug("Starting Swagger");
    StopWatch watch = new StopWatch();
    watch.start();
    ApiInfo apiInfo = new ApiInfo(frontendProperties.getSwagger().getTitle(),
            frontendProperties.getSwagger().getDescription(), frontendProperties.getSwagger().getVersion(),
            frontendProperties.getSwagger().getTermsOfServiceUrl(),
            frontendProperties.getSwagger().getContact(), frontendProperties.getSwagger().getLicense(),
            frontendProperties.getSwagger().getLicenseUrl());

    Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo)
            .genericModelSubstitutes(ResponseEntity.class).forCodeGeneration(true)
            .genericModelSubstitutes(ResponseEntity.class)
            .directModelSubstitute(java.time.LocalDate.class, String.class)
            .directModelSubstitute(java.time.ZonedDateTime.class, Date.class)
            .directModelSubstitute(java.time.LocalDateTime.class, Date.class).select()
            .paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());
    return docket;
}

From source file:de.codecentric.batch.metrics.AbstractBatchMetricsAspect.java

private StopWatch startStopWatch() {
    StopWatch stopWatch = new StopWatch();
    stopWatch.start();
    return stopWatch;
}

From source file:eu.transparency.lobbycal.config.apidoc.SwaggerConfiguration.java

/**
 * Swagger Springfox configuration.//from ww  w.ja va 2s.  c om
 */
@Bean
@Profile({ "!" + Constants.SPRING_PROFILE_DEVELOPMENT })
public Docket swaggerSpringfoxDocket(JHipsterProperties jHipsterProperties) {
    log.debug("Starting Swagger");
    StopWatch watch = new StopWatch();
    watch.start();
    ApiInfo apiInfo = new ApiInfo(jHipsterProperties.getSwagger().getTitle(),
            jHipsterProperties.getSwagger().getDescription(), jHipsterProperties.getSwagger().getVersion(),
            jHipsterProperties.getSwagger().getTermsOfServiceUrl(),
            jHipsterProperties.getSwagger().getContact(), jHipsterProperties.getSwagger().getLicense(),
            jHipsterProperties.getSwagger().getLicenseUrl());

    Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo)
            .genericModelSubstitutes(ResponseEntity.class).forCodeGeneration(true)
            .genericModelSubstitutes(ResponseEntity.class)
            .directModelSubstitute(java.time.LocalDate.class, String.class)
            .directModelSubstitute(java.time.ZonedDateTime.class, Date.class)
            .directModelSubstitute(java.time.LocalDateTime.class, Date.class).select()
            .paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());
    return docket;
}

From source file:br.com.antharys.config.apidoc.SwaggerConfiguration.java

/**
 * Swagger Springfox configuration.//from w  w  w . j  ava 2  s .c  om
 *
 * @param jHipsterProperties the properties of the application
 * @return the Swagger Springfox configuration
 */
@Bean
public Docket swaggerSpringfoxDocket(JHipsterProperties jHipsterProperties) {
    log.debug("Starting Swagger");
    StopWatch watch = new StopWatch();
    watch.start();
    Contact contact = new Contact(jHipsterProperties.getSwagger().getContactName(),
            jHipsterProperties.getSwagger().getContactUrl(), jHipsterProperties.getSwagger().getContactEmail());

    ApiInfo apiInfo = new ApiInfo(jHipsterProperties.getSwagger().getTitle(),
            jHipsterProperties.getSwagger().getDescription(), jHipsterProperties.getSwagger().getVersion(),
            jHipsterProperties.getSwagger().getTermsOfServiceUrl(), contact,
            jHipsterProperties.getSwagger().getLicense(), jHipsterProperties.getSwagger().getLicenseUrl());

    Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo).forCodeGeneration(true)
            .genericModelSubstitutes(ResponseEntity.class).ignoredParameterTypes(java.sql.Date.class)
            .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class)
            .directModelSubstitute(java.time.ZonedDateTime.class, Date.class)
            .directModelSubstitute(java.time.LocalDateTime.class, Date.class).select()
            .paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());
    return docket;
}

From source file:cn.fintecher.print.service.summons.config.apidoc.SwaggerConfiguration.java

/**
 * Swagger Springfox configuration./*from   ww  w.j  ava  2 s .  com*/
 *
 * @param summonsServiceProperties the properties of the application
 * @return the Swagger Springfox configuration
 */
@Bean
public Docket swaggerSpringfoxDocket(SummonsServiceProperties summonsServiceProperties) {
    log.debug("Starting Swagger");
    StopWatch watch = new StopWatch();
    watch.start();
    Contact contact = new Contact(summonsServiceProperties.getSwagger().getContactName(),
            summonsServiceProperties.getSwagger().getContactUrl(),
            summonsServiceProperties.getSwagger().getContactEmail());

    ApiInfo apiInfo = new ApiInfo(summonsServiceProperties.getSwagger().getTitle(),
            summonsServiceProperties.getSwagger().getDescription(),
            summonsServiceProperties.getSwagger().getVersion(),
            summonsServiceProperties.getSwagger().getTermsOfServiceUrl(), contact,
            summonsServiceProperties.getSwagger().getLicense(),
            summonsServiceProperties.getSwagger().getLicenseUrl());

    Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo).forCodeGeneration(true)
            .genericModelSubstitutes(ResponseEntity.class).select().paths(regex(DEFAULT_INCLUDE_PATTERN))
            .build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());
    return docket;
}

From source file:com.jeanmile.config.apidoc.SwaggerConfiguration.java

/**
 * Swagger Springfox configuration./*  ww w .  j  a  va  2  s  . co  m*/
 */
@Bean
public Docket swaggerSpringfoxDocket(JHipsterProperties jHipsterProperties) {
    log.debug("Starting Swagger");
    StopWatch watch = new StopWatch();
    watch.start();
    ApiInfo apiInfo = new ApiInfo(jHipsterProperties.getSwagger().getTitle(),
            jHipsterProperties.getSwagger().getDescription(), jHipsterProperties.getSwagger().getVersion(),
            jHipsterProperties.getSwagger().getTermsOfServiceUrl(),
            jHipsterProperties.getSwagger().getContact(), jHipsterProperties.getSwagger().getLicense(),
            jHipsterProperties.getSwagger().getLicenseUrl());

    Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo)
            .genericModelSubstitutes(ResponseEntity.class).forCodeGeneration(true)
            .genericModelSubstitutes(ResponseEntity.class)
            .directModelSubstitute(org.joda.time.LocalDate.class, String.class)
            .directModelSubstitute(org.joda.time.LocalDateTime.class, Date.class)
            .directModelSubstitute(org.joda.time.DateTime.class, Date.class)
            .directModelSubstitute(java.time.LocalDate.class, String.class)
            .directModelSubstitute(java.time.ZonedDateTime.class, Date.class)
            .directModelSubstitute(java.time.LocalDateTime.class, Date.class).select()
            .paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());
    return docket;
}

From source file:com.github.aksakalli.todo.config.SwaggerConfiguration.java

/**
 * Swagger Springfox configuration.//from  ww  w . j  ava  2 s  .com
 */
@Bean
public Docket swaggerSpringfoxDocket() {
    log.debug("Starting Swagger");
    StopWatch watch = new StopWatch();
    watch.start();
    Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo())
            .securitySchemes(newArrayList(new BasicAuth("test"))).genericModelSubstitutes(ResponseEntity.class)
            .forCodeGeneration(true).genericModelSubstitutes(ResponseEntity.class)
            .directModelSubstitute(org.joda.time.LocalDate.class, String.class)
            .directModelSubstitute(org.joda.time.LocalDateTime.class, Date.class)
            .directModelSubstitute(org.joda.time.DateTime.class, Date.class)
            .directModelSubstitute(java.time.LocalDate.class, String.class)
            .directModelSubstitute(java.time.ZonedDateTime.class, Date.class)
            .directModelSubstitute(java.time.LocalDateTime.class, Date.class).select()
            .paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());
    return docket;
}

From source file:com.todo.backend.config.SwaggerConfiguration.java

@Bean
public Docket swaggerSpringfoxDocket() {

    log.debug("Initializing swagger...");

    final StopWatch watch = new StopWatch();
    watch.start();

    final Docket docket = new Docket(DocumentationType.SWAGGER_2).forCodeGeneration(true)
            .genericModelSubstitutes(ResponseEntity.class).ignoredParameterTypes(Pageable.class)
            .ignoredParameterTypes(java.sql.Date.class)
            .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class)
            .directModelSubstitute(java.time.ZonedDateTime.class, Date.class)
            .directModelSubstitute(java.time.LocalTime.class, Date.class).select()
            .paths(PathSelectors.regex("/api/.*")).build();

    watch.stop();//from   w w  w  .  j  a  v a  2  s .com
    log.debug("Swagger started in {} ms", watch.getTotalTimeMillis());
    return docket;
}

From source file:com.ahmedeid.app.config.apidoc.SwaggerConfiguration.java

/**
 * Swagger Springfox configuration.//  w  ww  .j a  v  a 2 s . com
 *
 * @param jHipsterProperties the properties of the application
 * @return the Swagger Springfox configuration
 */
@Bean
public Docket swaggerSpringfoxDocket(JHipsterProperties jHipsterProperties) {
    log.debug("Starting Swagger");
    StopWatch watch = new StopWatch();
    watch.start();
    Contact contact = new Contact(jHipsterProperties.getSwagger().getContactName(),
            jHipsterProperties.getSwagger().getContactUrl(), jHipsterProperties.getSwagger().getContactEmail());

    ApiInfo apiInfo = new ApiInfo(jHipsterProperties.getSwagger().getTitle(),
            jHipsterProperties.getSwagger().getDescription(), jHipsterProperties.getSwagger().getVersion(),
            jHipsterProperties.getSwagger().getTermsOfServiceUrl(), contact,
            jHipsterProperties.getSwagger().getLicense(), jHipsterProperties.getSwagger().getLicenseUrl());

    Docket docket = new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo).forCodeGeneration(true)
            .genericModelSubstitutes(ResponseEntity.class).ignoredParameterTypes(Pageable.class)
            .ignoredParameterTypes(java.sql.Date.class)
            .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class)
            .directModelSubstitute(java.time.ZonedDateTime.class, Date.class)
            .directModelSubstitute(java.time.LocalDateTime.class, Date.class).select()
            .paths(regex(DEFAULT_INCLUDE_PATTERN)).build();
    watch.stop();
    log.debug("Started Swagger in {} ms", watch.getTotalTimeMillis());
    return docket;
}