com.google.sitebricks.example.Start Maven / Gradle / Ivy
The newest version!
package com.google.sitebricks.example;
import com.google.inject.Singleton;
import com.google.sitebricks.stat.Stat;
import com.google.sitebricks.At;
import com.google.sitebricks.Show;
import com.google.sitebricks.http.Get;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @author Dhanji R. Prasanna ([email protected])
*/
@At("/")
@Show("index.html") @Singleton
public class Start {
public static final String PAGE_LOADS = "page-loads";
public static volatile String HELLO_MSG = "YOU SHOULD NEVER SEE THIS!";
private String message = HELLO_MSG;
@Stat(PAGE_LOADS)
private final AtomicInteger pageLoads = new AtomicInteger();
public String getMessage() {
return message;
}
@Get void display() {
pageLoads.incrementAndGet();
}
}