@Stateless
@Path("ping")
public class PingResource {
static AtomicInteger counter = new AtomicInteger();
@GET
public Response ping() {
if (counter.incrementAndGet() > 10) {
System.out.println("++ UP");
return Response.ok("UP@" + System.currentTimeMillis()).build();
}
else {
System.out.println("++ DOWN");
return Response.serverError().build();
}
}
}