1 23 package org.infoglue.deliver.util; 24 25 31 public class Counter 32 { 33 private static Integer count = new Integer (0); 34 35 private Counter(){} 36 37 static int getNumberOfCurrentRequests() 38 { 39 return count.intValue(); 40 } 41 42 synchronized static void incNumberOfCurrentRequests() 43 { 44 count = new Integer (count.intValue() + 1); 45 } 46 47 synchronized static void decNumberOfCurrentRequests() 48 { 49 count = new Integer (count.intValue() - 1); 50 } 51 } 52 | Popular Tags |