title: Logic for controll concurrent in block/method
body: <p>1)My environment is web application, I develop servlet to receive request.    </p>
  
  <p>A) In <strong>some</strong> block/method i want to control concurrent to <strong>not greater than 5</strong><br>
  B) if there are 5 request in that block , the new coming must wait up to 60 second then throws error<br>
  C) if there are sleep/waiting request more then 30, the 31th request will be throwed an error</p>
  
  <p>How I do this?</p>
  
  <p>2)(Optional Question) from above  I have to distribute control logic to all clustered host.
  I plan to use <a href="http://www.hazelcast.com/documentation.jsp" rel="nofollow noreferrer">hazelcast</a> to share the control logic (e.g. current counter)  </p>
  
  <p>I see they provide BlockingQueue &amp; ExectorService but I have no idea how to use in my case.
  Please recommend if you have idea.</p>