• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Implementing the Singleton Pattern in EJB

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to access a singleton class from my EJBs. This class will be having some infromation that are common to most of my EJBs. I had planned to register it to the JNDI and then Lookup later from an EJB. Does this make sense?
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Rajesh Savitri:
Hi,
I need to access a singleton class from my EJBs. This class will be having some infromation that are common to most of my EJBs. I had planned to register it to the JNDI and then Lookup later from an EJB. Does this make sense?


Where will this singleton class be ? is it going to be in the same server as the EJBs or in a different JVM. Another thing, if you want only one instant of the singleton class per enviornment, your solution may help but if you are going to have one singleton class in all the JVM it is better to access the class thru its static reference.
 
I am Arthur, King of the Britons. And this is a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!