• Post Reply Bookmark Topic Watch Topic
  • New Topic

Implementing the Singleton Pattern in EJB  RSS feed

 
Rajesh Savitri
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?
 
Vinod Jon
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!