Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About Singletons.

 
Nitin Menon
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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.
Thanks..!('')
 
Alpesh Padra
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...

you can use same concept here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic