File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes File load Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "File load" Watch "File load" New topic
Author

File load

Tmmet Johnson
Ranch Hand

Joined: Nov 03, 2004
Posts: 56
Hi ,
I have many session beans.I have a properties file which has the app.
specific information.I am using the values from the properties file in all
my beans.
My question is "Is there any way to load the properties file only once,
that is, when the first ejb's method (Any ejb method can be invoked first.) gets invoked"?
I can put the code in ejbCreate() to load the properties file.
But, I don't want to repeat the same code in all ejb's ejbCreate()
methods .

I want to know whether a simple and better solution is there other than
the above.

Thanks in advance,
Annie Smith
Ranch Hand

Joined: Mar 05, 2005
Posts: 172
One possible way could be to use a singleton class to load the properties file.



Cheers!<br /><b>Annie</b>
Annie Smith
Ranch Hand

Joined: Mar 05, 2005
Posts: 172
Of course, I only typed that code on the fly. You will need to modify it to actually use it in a J2EE environment. I doubt if it is a good idea to use a singleton in J2EE environment.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File load