This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sharing an instance in one JVM

 
Paul Fonz
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application scope bean that controls database access. I want to use the instance of this object in a Java application I have made, which runs on the same server.
I am sure there is a way to use this instance, as it is somewhere in the Java Virtual machine on my server.
Can anyone tell me the way to do this?
Thanks,
Paul
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could take a look at the Singleton Design Pattern. http://c2.com/cgi/wiki?SingletonPattern
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic