Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

initializing singletones under j2ee  RSS feed

 
Nitzan Levi
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have some infrastructural singletons that needs to be initialized and need to be accessed by both ejb's and servlets.the web container and the ejb container dosent have to use the same JVM and also my ejb's dosent have to be on the same VM. because singletones are static(at least the classic pattern) i need to make sure that the initailazion will take place to all jvm's.
to solve this problem i can design it so every singltone will initialize him self but form where?
i cant use files because i'm not allowd to access them when i'm working under the EJB container.
dose any one solved this problem ?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can use files. That part of the EJB spec is not a hard-and-fast rule, but a suggestion. Nothing will stop you from reading a value from a properties file.
Kyle
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!