Could anybody please share code or tell me ways how to createpool of threads in java and allocate task to them when client requestcomes , something like that's being done in web container.