You require lot of coding for this.
1. Define property which holds the min and max number of objets (Threads)
e.g. min_thread=5
max_thread=10
min_wait_time=1000 (10 secs)
2. Write one custom code and this code would
2.1 On startup create the min # of objects and store in some collection.
2.2 Everytime this object gets used - set one counter
2.3 When this counter goes beyond min, then create a new instance and add that into the collection and then return to the client.
2.4. Increment the conter.
2.5 Whenever the object is released , return the same thread to the collection.
2.6. Decrement the counter.
2.7. When the counter is less than min and objects are released, then remove them from the colllection (maintain only min)
2.8. When the max level is reached then throttle the new client request by waiting for the time (min_wait_time) and then timing out if no object is available in that time.