In my application, there is a module where no more than three users should login simultaneously. It has a functionality where a PDF file is created and mailed. I had read about about singleton beans. I would love to know how singletons are processed. Also, What are their specialties and the scenarios in which they are used.
posted 5 years ago
You can provide static int variable as member of singlton class which can increament n decrement on every login - logout.
By using singlton pattern you can restrict number of instance for class like 5, 10...
if you know then connection pooling n thread pooling concept over there . we are using same concept...