Code example for AtomicInteger

Methods: intValue

0
     */ 
    private static class InitCount extends HttpServlet { 
 
        private static final long serialVersionUID = 1L;
 
        private AtomicInteger callCount = new AtomicInteger(0);
 
        @Override 
        public void init() throws ServletException { 
            super.init(); 
            callCount.incrementAndGet();
        } 
 
        @Override 
        protected void doGet(HttpServletRequest req, HttpServletResponse resp)
                throws ServletException, IOException { 
            resp.setContentType("text/plain");
            resp.getWriter().print("OK");
        } 
 
        public int getCallCount() { 
            return callCount.intValue();
        } 
    } 
 
 
    /**