PageRenderTime 87ms CodeModel.GetById 30ms app.highlight 2ms RepoModel.GetById 53ms app.codeStats 0ms

/sitebricks-acceptance-tests/src/main/java/com/google/sitebricks/example/Start.java

http://github.com/dhanji/sitebricks
Java | 31 lines | 22 code | 6 blank | 3 comment | 0 complexity | 1df5a5bfcb4a2131fa010b7bbf2e7943 MD5 | raw file
 1package com.google.sitebricks.example;
 2
 3import com.google.inject.Singleton;
 4import com.google.sitebricks.stat.Stat;
 5import com.google.sitebricks.At;
 6import com.google.sitebricks.Show;
 7import com.google.sitebricks.http.Get;
 8
 9import java.util.concurrent.atomic.AtomicInteger;
10
11/**
12 * @author Dhanji R. Prasanna (dhanji@gmail.com)
13 */
14@At("/")
15@Show("index.html") @Singleton
16public class Start {
17  public static final String PAGE_LOADS = "page-loads";
18  public static volatile String HELLO_MSG = "YOU SHOULD NEVER SEE THIS!";
19  private String message = HELLO_MSG;
20
21  @Stat(PAGE_LOADS)
22  private final AtomicInteger pageLoads = new AtomicInteger();
23
24  public String getMessage() {
25    return message;
26  }
27
28  @Get void display() {
29    pageLoads.incrementAndGet();
30  }
31}