Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic