Tomcat and maximum number of requested accepted
===

Is there a way to configure Tomcat to reject a request after a specific threshold number? E.g. after 506 requests start rejecting.    
Is there such an option or am I supposed to write code for this?  